Cannot Upload With ASP Upload

Discussion in 'Classic ASP' started by DJMarxus, Jan 3, 2005.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. When I try to upload with ASPUpload,I get this error: AN ERROR OCCURRED:
    WRONG NUMBER OF ARGUMENTS OR INVALID PROPERTY ASSIGNMENT
    YOUR FILE WAS NOT UPLOADED.


    I checked permission manager and the folder has Read/Write access allowed for Anonymous. I do NOT have Server Extensions installed.

    I tried setting up the "Upload.LogonUser" function for ASPUpload to specify authentication with my uploads, but it seems DiscountASP disabled that.

    When I call "Upload.SaveVirtual", I doNOT specify parameters (ie: the directory path) because I want to upload the file to memory. Could that be the problem?

    Please help.

    Thanks,
    Mark
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    This error does not indicate a permission problem.

    >When I call 'Upload.SaveVirtual', I do NOT specify parameters (ie: the directory path) because I want to upload the file to memory. Could that be the problem?

    This looks like it is the problem.

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. Unfortunately, when I specify a directorypathargumentfor SaveVirtual, it will immediately upload the image to that directory.
    I need to resize the image first with ASPImage before it saves to that directory.
    This all works when I do it from my local server, simply because I can use Upload.Save and it doesn't require arguments.
    Since Upload.SaveVirtual requires arguments, then I cannot resize my image in discountASP.
     
  4. Okay, I actually CAN resize the imageAFTER it's been uploaded.
    But the problem with that is, I cannot rename it.

    The reason why I was uploading the image to memory before saving it, was that I was prefixing the image nameswith"thumb", resizing, then saving to the directory.

    If I save the imageto the uploaddirectory right away by giving "Upload.SaveVirtual" an argument, then resizing it after, I cannot prefix it's namewith the word "thumb" anymore. It's stuck with the original name it had before it was uploaded. Because ASPUpload's File Object does not have a File.Rename function.
     
  5. See, the code I had before used: Upload.Save (without parameters, therefore uploading the image to memory, not the uploads directory)


    Then I would use: Set File = Upload.Files(1)


    Then: File.SaveAs (Server.MapPath("uploads") & "/thumb" & File.FileName) (this line allows me to rename the image before saving it)


    This creates one file in the uploads directory, and that files name has been prefixed with "thumbs".


    -------------------------------------
    but if I do this...
    -------------------------------------


    Upload.SaveVirtual "uploads/" (SaveVirtual, for some reason requires an argument)


    Set File = Upload.Files(1)


    File.SaveAsVirtual ("uploads/thumb" & File.FileName)


    ... then 2 images getcreatedin the uploads directory. One is from the first line with the original filename, the second is from the third line with the modified filename (prefixed with "thumb").


    I need to upload only 1 image with the name prefixed "thumb".
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page