Jump to content

Can't figure it out


Akasha

Recommended Posts

hello after some research on the internet i came to the conclusing that you cannot use request.from and uploading a filebecause you get this error:Cannot use the generic Request collection after calling BinaryRead. the gave several solutions like use Upload.form or FormUploadRequest instead of request.form I have tried it but it still won't work :)I use the code from FreeASPUploadit would be nice is i could use variables from my page and use the file uploador else i have to split te form in 2 parts :)does anyone has a solution??greetings Leandra

Link to comment
Share on other sites

I myself chose an "inovative and original" 2 page solution. After the data is inserted redirect the user to the upload form or present him with the upload form just after the success message for the insertion of data.

Link to comment
Share on other sites

Can't i include the upload page into my normal form or something

Link to comment
Share on other sites

if u can find a way to insert/update the info in your DB and at the same time upload your files...I needed to upload accordig to an "id" field so first i needed to do the data insertion/update an d afterwards do the upload by taking the ID of the data previusly inserted/updated.hope i've been coherent... :)

Link to comment
Share on other sites

FINALLY..... IT WORKS i found out how it works pffiieeeuuuwww!!!!hahaha i' am starting to become a real programmer :( i looked at the documentation of AspUpload and found out you can indeed use Upload.form to retrieve data from a form.But when i used it i got this error

Microsoft VBScript runtime error '800a01a8'  Object required: ''

i found out that the page was trying to use an object that wasn't created yet.i only gets created after the submitso i first had to check if a submit was donedid it with the line:

if Request.ServerVariables("REQUEST_METHOD") = "POST" then

so got the variables out of the form and send it to the databasework absoluty fine and my file was also uploadedthe only i needed to do now was to send te filename to the databasetherefore i used this code

    dim Upload, fileName Set Upload = New FileUpload    Upload.Save(uploadsDirVar)	for each fileKey in Upload.UploadedFiles.keys            SaveFiles = Upload.UploadedFiles(fileKey).FileName     next

and used the SaveFiles in my queryand now it all works :):):D:blink::)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...