Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - File & image upload improvement...
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

File & image upload improvement...

 Post Reply Post Reply Page  12>
Author
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post Posted: 26 May 2003 at 12:01pm

Originally posted by -Borg- -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
Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.