What is the proper code for file uploading.

  • Thread starter Thread starter Mark Sandfox
  • Start date Start date
M

Mark Sandfox

I have tried everyway i know both Input type=file and asp.net 2.0
asp:uploadfile and continue to run into road blocks at one point or another.



The objective is as follows:



Allow user to upload multiple files of a specific extension (i.e. .jpg). In
addition to uploading to a specific directory, I need to extract the
filename and extension to store in a database (don't worry about the
database side).



I have tried UploadFile but get a parsing error on the <asp:UploadFile line.



I had input working except for restricting file extension type.



Any and all help will be greatly appreciated.



Thank you in advance for all you help.
 
Your form tag should be something like this..
<form method="post" enctype="multipart/form-data"
action="upload.asp">
 
Yes that much i knew, but thank you. The problem arrises when using the
input type=file method is that i can not get the filter to only allow .jpg.
Any suggestions?
 

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

Back
Top