| Author |
Topic Search Topic Options
|
fernan82
Mod Builder Group
Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
|
Post Options
Thanks(0)
Quote Reply
Topic: File & image upload improvement... Posted: 24 May 2003 at 7:22pm |
|
It would be nice if instead of storing the uploaded files in a folder by the username they could be prefixed with the thread id and that whenever the post gets deleted the files get deleted too, would that be too much to ask?
|
FeRnAN
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Post Options
Thanks(0)
Quote Reply
Posted: 26 May 2003 at 9:01am |
|
It wouldn't be possible as the thread ID does not exsit till the post is submitted, file and image uploads are done before the file is submitted.
|
|
|
 |
ljamal
Mod Builder Group
Joined: 16 April 2003
Status: Offline
Points: 888
|
Post Options
Thanks(0)
Quote Reply
Posted: 26 May 2003 at 10:27am |
|
But it is possible to rename the file after upload and after the post has been made. Renaming files is a FileSystemObject method and if you have enough permissions to upload you should be able to rename and later delete the attachment.
If I get some time later, maybe I will script this as a MOD. I can see how this could be useful because it provides a means of easily identifying the file as well as clearing web space. No reason to have the file if the thread is not there.
|
|
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Post Options
Thanks(0)
Quote Reply
Posted: 26 May 2003 at 11:53am |
I know you can use the FSO object to rename files but it's not as simple as that.
Uploaded files and images don't have there names stored in the database or in a sepperate text box, so you would then have the probalem of trying to identify an uploaded file or image from within a post get the directory name, change the derectroy name, then change the link within the post.
Also many server admins disable the FSO object for security reasons, if this is the case then these people will not be able to use the upload functions, this is why I try to stay away from using the FSO object.
|
|
|
 |
fernan82
Mod Builder Group
Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
|
Post Options
Thanks(0)
Quote Reply
Posted: 26 May 2003 at 12:01pm |
-Borg- wrote:
It wouldn't be possible as the thread ID does not exsit till the post is submitted, file and image uploads are done before the file is submitted.
|
rite, i didn't taught about it, maybe if you prefix them with the Session ID you can keep track of them and then rename them after the thread id once the post is submitted as ljamal suggested...
<edit> well nevermind, after reading your last post i see my suggestion is no good niether as you would also have to use the FSO....
Edited by fernan82
|
FeRnAN
|
 |
ljamal
Mod Builder Group
Joined: 16 April 2003
Status: Offline
Points: 888
|
Post Options
Thanks(0)
Quote Reply
Posted: 26 May 2003 at 12:22pm |
|
I've never known a host to disable the FileSystemObject and why would they disable FSO and allow file uploads?
I haven't looked at the file upload structure since I don't use it, but ...
To circumvent the FSO altogether you could just change the order of the upload and post and rename the image during the upload which now occurs after the post. Is there no current system to clean up attachments?
|
|
|
 |
fernan82
Mod Builder Group
Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
|
Post Options
Thanks(0)
Quote Reply
Posted: 26 May 2003 at 8:57pm |
I might just write a script that go thru the database looking for links to each uploaded file, if it don't find a link to it in the db it would then delete it.... and i'll just run the script once in a while.....
|
FeRnAN
|
 |
fernan82
Mod Builder Group
Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
|
Post Options
Thanks(0)
Quote Reply
Posted: 26 May 2003 at 9:27pm |
We better be happy with what we got, if we don't like anything about the forum we can always mod it and it's free so what more can we ask?
Besides Borg gets a little emotional when we criticize it's ways, i notice the other topic about the polls got locked so i ain't even gonna bother anymore with anything like this.............
|
FeRnAN
|
 |