Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Insert Record and Upload file?? multipart/form-data problem

Guest
Jul 03, 2006 Jul 03, 2006
Hello,

I wasnt to do something that sounds simple. But I can't get it to work with dreamweaver. I have a form that inserts information into a database. It also has a file field that uploads an image.

When I set the form attribute: enctype="multipart/form-data" then the file upload works fine, but the information does not get inserted into the database.

When I set the form attribute: enctype="application/x-www-form-urlencoded" then the information gets inserted into the database, but he file does not upload.

Does anyone know how to get them both working at the same time?

Thanks!
TOPICS
Server side applications
504
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 03, 2006 Jul 03, 2006
When I search on google I see people say change Response.Form to Response.Binaryread.

But I'm not sure exactly how this should change. I did a find and replace, but it didn't work.



Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 03, 2006 Jul 03, 2006
I found this in the upload scripts read me file:

The clsUpload object contains public functions and methods which enable you to upload and save files to a web server using pure VBScript.

Read only

Data Type: Dictionary Collection

Syntax: object.Form

Returns a Forms collection consisting of all the Form objects parsed from the HTTP header.

This collection contains all the HTML form elements which are not "Files"

This collection should be used instead of the typical "request.form" method to access data from the other form elements (if you decide to combine "file" upload elements with other form element types, like checkboxes, text boxes, drop-down lists, textareas). Why? Because the form data is posted using "multipart/form-data" encoding (and needs to be retrieved like binary data instead of text data) and therefore the typical "request.form" method isn't effective.


-----------

I changed request.form to clsUpload.form but it still did not work.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 04, 2006 Jul 04, 2006
LATEST
Instead of using Request.Form, try using the name of the uploader object in place of the Request, eg. if your uploader object was called UploaderObj, then use UploaderObj.Form
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines