validating based on file extension
Hey Ray
On the attached page, how would I validate to stop non image based file extensions from being uploaded?
Thnaks
Jamie
Hey Ray
On the attached page, how would I validate to stop non image based file extensions from being uploaded?
Thnaks
Jamie
The file upload server behavior has a checkbox to allow images only. You should start by checking that.
To show an error message when a non-image is uploaded you would have to move the upload code above the validation code and then you could validate the file extension. I think it will be blank once you check the allow images only checkbox when a non image is uploaded.
thanks for the reply, the 'web only' is already checked.
reason I asked this was that a user tried to upload a pdf and the update page submitted successfully but it entered null in the image column
Yes. If you move the upload code above the validation you can use server validation to stop the insert and show an error message when it is blank.
ok will have a crack at that later. cheers
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
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.