upload only *.xls file...

G

Guest

helo, how can i control from the client side to only upload *.xls files?
i want the upload box to only see xls file... thanks


Asha
 
G

Guest

Dear Asha,

You can check the file extension of the URL of the uploaded file and if its not .xls, then you can throw a msgbox or repsonse.write to inform the user to upload only xls files.

the input type=file's textbox is not settable, i mean you cant set values so may be you can alert the user and once they select a different (excel) file, the url will be overwritten.

if you want the code to check the file extension, i can give you.

thanks
 
K

Kevin Spencer

Hi Ahsa,

On the client side, you can access the path to the file as a string in the
"value" attribute of the "input type=file" field for uploading your file,
prior to submitting the form, as soon as they select it (using the
"onpropertychange" event handler for the "input type=file" element). It is a
string. Check the extension, and don't allow the user to submit the form
unless the form field is empty or the value has the correct file extension.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top