Hej! Testa med: Hej!Fråga om MySmartUpload ? [LÖST]
Får detta fel på koden nedan. Rättigheter för mapparna är satta till read och write.
Tacksam för hjälp.
Felmed:
Object required: 'mySmartUpload'
/pressrelease/fileupload.asp, line 16
Sid2:
<code>
<% Set ObjFolder = CreateObject("Scripting.FileSystemObject")
strPath=Server.MapPath("/pressrelease/testmapp/")
If not ObjFolder.FolderExists(strpath) then
ObjFolder.CreateFolder strPath
end if
Set myUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
myUpload.upload
file1 = mySmartUpload.Form("file1") <--- ****rad 16***
file2 = mySmartUpload.Form("file2")
file3 = mySmartUpload.Form("file3")
file4 = mySmartUpload.Form("file4")
file5 = mySmartUpload.Form("file5")
if len(file1)>0 then
file.SaveAs(strPath & file1)
end if
if len(file2)>0 then
file.SaveAs(strPath & file2)
end if
if len(file3)>0 then
file.SaveAs(strPath & file3)
end if
if len(file4)>0 then
file.SaveAs(strPath & file4)
end if
if len(file5)>0 then
file.SaveAs(strPath & file5)
end if
Close.myUpload
%>
</code>
Del av Sid1:
<code>
<FORM METHOD=POST ENCTYPE="multipart/form-data" ACTION="fileupload.asp" onsubmit="return formvalidation(this)" >
<center><h4>Send attachments</h4>
</center>
File/Files:<br>
<input type="file" name="file1" value="Browse"><br>
<input type="file" name="file2" value="Browse"><br>
<input type="file" name="file3" value="Browse"><br>
<input type="file" name="file4" value="Browse"><br>
<input type="file" name="file5" value="Browse"><br><br>
Contact email address:<br>
<INPUT TYPE="text" NAME="email">
<p>
<center>
<input type="submit" value="Add file/files">
</center>
</FORM>
</code>Sv: Fråga om MySmartUpload ?
<code>
<%
Dim strPath
Dim ObjFolder
Dim myUpload
strPath=Server.MapPath("/pressrelease/testmapp/")
Set ObjFolder = CreateObject("Scripting.FileSystemObject")
If not ObjFolder.FolderExists(strpath) then
ObjFolder.CreateFolder strPath
end if
Set ObjFolder = Nothing
Set myUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
myUpload.upload
For each file In mySmartUpload.Files
If not file.IsMissing Then
file.SaveAs(strPath & file.FileName)
End If
Next
Set myUpload = Nothing
%>
</code>Sv: Fråga om MySmartUpload ?
Jag fick det att fungera med min kod, jag lade allt i en ny mapp och satt rättigheter till den. Vet inte varför det strulade innan.
Tack.