0

Possible Duplicate:
how to upload files with asp-classic

I have classic asp form which has some input textboxes and dropdowns. It also has a fileupload control. all inputs are enclosed in one form I want to upload the file as well as submit the data to database. Can I do both database insertion as well as fileupload using classic asp on one button click ? How can I upload the file using classic asp. do I need to add some attribute to form element ?

Community
  • 1
  • 1
DotnetSparrow
  • 27,428
  • 62
  • 183
  • 316

1 Answers1

1

Yes you can do both with one click, save the data to the database and upload the file. You need to add enctype="multipart/form-data" to your form tag.

Uploading a file is slightly trick but it is possible, you can see and example of how it's done here:

http://www.freeaspupload.net/freeaspupload/viewsource.asp

Hope this helps.

03Usr
  • 3,335
  • 6
  • 37
  • 63
  • Also be warned that there is a default upload limit of 2mb, you can change that however but be sure to test with 'big-files' – Paul Jul 06 '12 at 17:28
  • 1
    True, but also note that by adding this you won't be able to read the form elements by using Request.Form as you will get gibberish - you'll have to use the upload script to read those values. – Shadow The GPT Wizard Jul 08 '12 at 07:01