Skip to main content
July 3, 2006
Question

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

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!
This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

July 3, 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
Participating Frequently
July 4, 2006
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
July 3, 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