upload only *.xls file...

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
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.
 
Back
Top