Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

File Upload...

Quote Reply
File Upload...
I've added the following to a form in the user profile section:

Code:
<input type="file" name="user_gallery_image1">

The file upload works as it should, but now I need to know how allow the user to delete the file. Is there something I can put in the form to delete the image that was uploaded?

Sean

Last edited by:

SeanP: Jan 10, 2005, 1:29 PM
Quote Reply
Re: [SeanP] File Upload... In reply to
You may find that it isn't actually working properly - it may be storing just the local path on your system, which will work for you, but show up as a broken image for someone else. That said, GForum does have the ability to handle alternative user icon uploads if you use a column name starting with "user_icon" - in this case, perhaps try "user_icon_gallery1".

To do the upload, you would use a file field with a name of: "user_icon_gallery1_upload", then also provide a "user_icon_gallery1" field - if the form is submitted with a file field, it'll be uploaded to the server, otherwise if the user_icon_gallery1 is blank, it'll be cleared, so you use a third field set to the current value.

All of the above is already done for the user_icon field - the easiest way to do this is probably to take the user_icon template code from the profile page, and copy and paste it, changing "user_icon" to "user_icon_gallery1".

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com