Search code examples
postdllasp-classiccom64-bit

Post Form but lost parameter


I am working the OS update from x86 to x64 now.

Here is a .asp project that work fine on x86 but not fine on x64.

The problem is x64 can't get the form parameter after post.

tgtdir = mySmartUpload.Form("tgtdir").Values

tgtdir is empty!!!

Is IIS setting problem? or something else?

Please feel free to leave the answer or comment if you have any idea.

Some code that I write is...

In Main.asp

<HTML>
<HEAD>
  <TITLE></TITLE>
</HEAD>
<BODY topmargin=4  leftmargin=10 bgcolor=wheat>
  <FORM id=form01 name=form01 align=center enctype="multipart/form-data">
    <TABLE width=100% align=center>
      <TR>
      <TH>
        <FIELDSET>
          <TABLE>
            <TR>
              <TD colspan=2>
                <INPUT type=file id=file01 name=file01 style="WIDTH: 400 px" value="Preview">
            <TR>
          </TABLE>
        </FIELDSET>
      </TH></TR>
    </TABLE>    
    <INPUT type=hidden id=tgtdir name=tgtdir value="AAA">
  </FORM>
  <DIV>
    <IFRAME id=frameUpload name=frameUpload >
    </IFRAME>
  </DIV>
</BODY>
</HTML>

In fileupload.asp

<HTML>
<HEAD>
  <TITLE></TITLE>
</HEAD>
<BODY>
<% 
On Error Resume Next
    Dim mySmartUpload
    Dim intCount

    Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")

    mySmartUpload.CodePage = "utf-8"
    mySmartUpload.Upload

    Set fso = Server.CreateObject("Scripting.FileSystemObject")
    tgtdir = mySmartUpload.Form("tgtdir").Values

    intCount = mySmartUpload.Save(tgtdir & "\") 
%>
</BODY>
</HTML>

Solution

  • Now that you have provided some key information that was originally missing I might be able to help.

    While what I said in the comments about Request.Form in conjunction with Request.BinaryRead() is correct, I don't think that's the issue (confusion from the original revision of the question).

    In fact, I believe what @Vanquished Wombat said:

    So what is aspSmartUpload? This page says "A 32-bit library to facilitate file uploads via ASP Classic and IIS."

    is closer.

    So I did a little digging (as I don't use aspSmartUpload myself) and it turns out that (according to the last reported scan of the site on Wayback Machine) sometime before Jan 2008:

    The aspSmart line of products has been discontinued.

    While there is nothing wrong with this in itself it did make me think they probably didn't release a 64-bit version of the component, so the issue is going to be trying to run a 32-Bit COM DLL in a 64-bit environment.

    I've spoken about this many times but for a complete breakdown of what you need to get it working see Error ASP 0177: 8007007e Server.CreateObject fails for COM DLL.

    What is weird, is you haven't posted an error. If the DLL wasn't correctly registered in the 32-bit sub-system or the IIS site wasn't running it's App Pool in 32-Bit mode I'd expect some kind of error.

    My advice would be to go through the steps in that answer and check against your setup, there is even a COM DLL Checklist at the bottom for you to check against.