close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

DELETE FILE - only if field is not empty

Thread began 3/25/2013 12:01 pm by Cologne | Last modified 3/26/2013 10:48 am by Cologne | 1811 views | 4 replies

Cologne

This works.

I need some advice, or better, am I doing right.

The user can upload an image on a profile update page. Will say, the image filed is empty.
And I store nothing in the hidden field for the current image.

The new image, if the user uploads an image gets a random password (SA) that I store in a session when button pressed.

So, am I right, that I need 2 triggers for the old image delete function?

Cause, if the hidden field for the current image is empty I get an error message.
Then I need an other trigger to check if an upload was done, to delete the old image.

if there is no image, take the hidden field (current image) as default in the upload, and so it stays empty.

in case of upload a new image, the hidden field is not empty, the upload is done, so the old image can be deleted.

is this the right way, or is there an other, better way to do this.

Cheers,
Denis

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...