-3

Im trying to upload pictures using form in ASP classic. Found this piece of code that uses two asp class files written - clsUpload.asp and clsFields.asp.

The upload file looks something like this:

Dim objUpload 
Dim strFile, strPath
' Instantiate Upload Class '
Set objUpload = New clsUpload
strFile = objUpload.Fields("file").FileName
strPath = server.mappath("/data") & "/" & strFile
' Save the binary data to the file system '
objUpload("file").SaveAs strPath
Set objUpload = Nothing

But I think the code is trying to save the picture into database using a binary data field. Want I want is to save the picture into the folder and save the filename to a database field.

Any idea how to do it?

Community
  • 1
  • 1
  • 2
    Where are the DB connections and SQL statements if you're thinking it saves it to a DB. Have you tried it at all? – pee2pee Nov 17 '15 at 09:18
  • 1
    No - the file is being uploaded to a folder called `data` under your root folder. – Paul Nov 17 '15 at 09:21
  • I'll refer to this post for the contents of the two asp class files: http://stackoverflow.com/a/12200970/1443624 When run, it gives the error "Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another." Then points to line in the class file which appends new record to the database which should not be the case. – Leander Bellen Nov 17 '15 at 13:06
  • At least update the question detailing the error and show a snippet of the class code where the error occurs, otherwise what do you expect us to do? The fact you get a `Arguments are of wrong type, are out of acceptable range or in conflict with one another` tells you something is wrong and whether you believe it should be the case or not is irrelevant. – user692942 Nov 18 '15 at 09:47

1 Answers1

0

Make sure the 'data' folder exists. It will be in the root in this case I think.

You will need a separate script to write the filename to a db.

Amos Fox
  • 308
  • 1
  • 10