如何将图像上传到经典asp中的文件夹

时间:2015-06-25 11:30:41

标签: asp-classic

我正在使用旧的经典ASP处理表单。而这个经典ASP不支持enctype = multipart / form-data。如果我使用multipart / form-data,那么在提交表单后我没有得到任何价值。所以请告诉我如何在不使用multipart / form-data的情况下将图像上传到文件夹中。任何帮助将不胜感激。 提前致谢

1 个答案:

答案 0 :(得分:0)

我知道痛苦

检查一下 http://www.codeproject.com/Articles/2359/File-Upload-using-a-VBScript-Class

如果你想访问其他表单元素,请使用

Upload.Form("cmbtemp")

这可能对你有所帮助,如果不告诉我,我会把你用来的东西发给你

编辑代码 表格代码

<form name="frmSend" method="POST" enctype="multipart/form-data" accept-charset="utf-8" action="upload_pdf.asp"  >

和上传代码

function SaveFiles

    Dim Upload, fileName, fileSize, ks, i, fileKey
    DIM oufilename1,oufilename2,cmbtemp
    Set Upload = New FreeASPUpload
    Upload.SaveOne uploadsDirVar,0,oufilename1,oufilename2

    cmbtemp=Upload.Form("cmbtemp")
    'response.Write(cmbtemp)

    if oufilename2 <> "" and cmbtemp <> "" then 

    con.execute "update tbltemp set file_name='"&oufilename2&"' where ID='"&cmbtemp&"'"
    end if 

    ' If something fails inside the script, but the exception is handled
    If Err.Number <> 0 then Exit function

end function

此功能在发布请求时调用