Forums

ASP

This topic is locked

Making Pure ASP Upload work with MX Record Update

Posted 30 Sep 2003 03:40:15
1
has voted
30 Sep 2003 03:40:15 Peter Mahoney posted:
I've been using Pure ASP Upload for some time. Personally, I think it's great. I just have one problem. And it's kind of a biggie.

When making a record update page using the built in MX behahviour, I also need to allow people to change the picture on the page, by uploading a new one if required.

However, if they leave this file field blank and save the changes, it automatically updates the page - but overwties the existing picture name in the database with a blank entry.

I can't work it out. When it loads the update page it's designed to bring in the current field from the database into the file upload box.

Does anyone know how this is fixed? Others must surely have had this problem?

Replies

Replied 03 Oct 2003 00:38:23
03 Oct 2003 00:38:23 Doug Maynard replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
...

When making a record update page using the built in MX behahviour, I also need to allow people to change the picture on the page, by uploading a new one if required.
etc ...<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

My cure for the same problem was crude but effective. I split up the job into two pages.

On the 'edit the database' page, instead of the file input tag I put the filename in a hidden file. I also display a thumbnail size version of the actual image (so the guy can see what he's got) and an 'upload new image' button. If he doesn't click the upload new image button, he can edit all the rest of the record without affecting the image. Also he's not required to re-upload the image if he doesn't want to change it

If he clicks the upload new image buttoin he goes to a page that just has the one file field and the upload behavior. The upload is required here - so an empty file field doesn't work, but there's a cancel button if Mr User decides not to do it. After the successful upload (or cancel) we move back to the previous 'edit the database database' page - now showing the new image.

So by splitting out the upload the image from all the rest of the database upload, the user can fiddle with all the other fields in the database without changing the image.

Sounds more complicated than it is, but it's obvious to the user, and is pretty flexible.

Good luck

Doug
Replied 03 Oct 2003 00:41:42
03 Oct 2003 00:41:42 Peter Mahoney replied:
Thanks mate. Thats not a bad idea.

Reply to this topic