webForumDet fria alternativet

stul med aspUpload

1 svar · 251 visningar · startad av WebbisNet

WebbisNetMedlem sedan feb. 20032 027 inlägg
#1

Denna kod har funkat helt utmärkt men strular nu

Set Upload = Server.CreateObject("Persits.Upload")
Upload.OverwriteFiles = False
Upload.SetMaxSize 100000, False
Count=Upload.Save(Server.MapPath("/images/gallery"))
For Each file In Upload.Files
  If File.ImageType = "UNKNOWN" Then
  
      Response.Redirect "/pictureupload/gallery/?error=filetype"
      File.Delete 
   End If
  Next
For Each file In Upload.Files

If file.Size = 100000 Then

        Response.Redirect "/pictureupload/gallery/?error=fileTooBig"
    File.Delete 
    End If
Next

Set File = Upload.Files

rubrik = replace(Upload.form("txtRubrik"),"'","''")
kommentar = replace(Upload.form("txtKommentar"),"'","''")

If NOT File Is Nothing Then
On Error Resume Next
strFileName= Upload.Files("blob").ExtractFileName  

END IF

Persits.Upload.1 error '800a0005'

The system cannot find the file specified.

/pictureupload/gallery/persist.asp, line 7

Rad7 är Count=Upload.Save(Server.MapPath("/images/gallery"))

och om jag använder aspSmartUpload så får jag
aspSmartUpload.File error '80040460'

Unable to save file (Error 1120)

/pictureupload/gallery/persist.asp, line 18

Rad 18 är
file.SaveAs("/images/gallery/" & file.Name & "." & file.FileExt & "")

med denna kod

 Dim mySmartUpload
   Dim file
   Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
   mySmartUpload.AllowedFilesList = "jpg,png"
   mySmartUpload.DenyPhysicalPath = True
   mySmartUpload.MaxFileSize = 100000
   mySmartUpload.Upload

   Set file = mySmartUpload.Files("blob") 
   
    If file.IsMissing Then
        Response.Write("Filen saknas!<BR>")        
    Else
        strFil = file.FileName
        file.SaveAs("/images/gallery/" & file.Name & "." & file.FileExt & "")

        'Response.Write("Name = " & file.Name & "<BR>")
        'Response.Write("Size = " & file.Size & "<BR>")
        'Response.Write("FileName = " & file.FileName & "<BR>")
        'Response.Write("FileExt = " & file.FileExt & "<BR>")
    End If
WebbisNetMedlem sedan feb. 20032 027 inlägg
#2

jag får med filnamnet, ser det när jag skriver ut strFil, men därefter är det stopp

strFil = file.FileName
response.write strFil
'response.end
file.SaveAs("/images/gallery/" & strFil &"")

128 ms totalt · 3 externa anrop · v20260731065814-full.86db40fa
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
125 ms — hämta tråd, inlägg och bilagor (db)