Visualizzazione dei risultati da 1 a 7 su 7
  1. #1
    Utente bannato
    Registrato dal
    Jan 2003
    Messaggi
    2,407

    procedura di upload [non mi trova la path]

    salve,

    codice:
    
    <%
    
      Response.Expires=0
      Response.Buffer = TRUE
      Response.Clear
      byteCount = Request.TotalBytes
      RequestBin = Request.BinaryRead(byteCount)
      Dim UploadRequest
      Set UploadRequest = CreateObject("Scripting.Dictionary")
    
      BuildUploadRequest  RequestBin
      contentType = UploadRequest.Item("foto").Item("ContentType")
      filepathname = UploadRequest.Item("foto").Item("FileName")
      filename = Right(filepathname,Len(filepathname)-InstrRev(filepathname,"\"))
      value = UploadRequest.Item("foto").Item("Value")
    
     
     
     flag=0
    	
     if cstr(filepathname)<>"" then	
    
    
      if LenB(value)<=3000000 then
      
    	  if ucase(cstr(Right(cstr(filepathname),4)))=".PDF" then  
    
    
    			filename="Edizione" & cstr(Session("Edizione")) & cstr(Right(cstr(filepathname),4))
    	
    		  'Create FileSytemObject Component
    		  Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject")
    		
    		  'Create and Write to a File
    		  pathEnd = Len(Server.mappath(Request.ServerVariables("PATH_INFO")))-14
    		  
    		  
    		  Set MyFile = ScriptObject.CreateTextFile(Left(Server.mappath(Request.ServerVariables("PATH_INFO")),pathEnd) & "public\" & filename)
    		 
    		  For i = 1 to LenB(value)
    			 MyFile.Write chr(AscB(MidB(value,i,1)))
    		  Next
    		  MyFile.Close
    
    		  
    	  else
    	  	flag=2
    	  end if
    	  
      
      else
      	flag=1
      end if
    
    	else
    		flag=3
    	end if
    	
    
    
      if cint(flag)=0 then
      	 response.redirect("ins_striscia_reg1.asp?filename=" & filename)
      else
      	 response.redirect("inserimento_striscia_pdf.asp?Errore=" & flag)	
      end if
    
    %>
    e l'errore alla linea 39 è:


    codice:
    Microsoft VBScript runtime error '800a004c' 
    
    Path not found 
    
    /outputfilepdf.asp, line 39
    dove la linea 39 è:

    codice:
    Set MyFile = ScriptObject.CreateTextFile(Left(Server.mappath(Request.ServerVariables("PATH_INFO")),pathEnd) & "public\" & filename)
    sapreste dirmi il perchè...??


    Grazie

  2. #2
    ma perchè non scrivi:

    codice:
    Set MyFile = ScriptObject.CreateTextFile(Server.MapPath("\") & "/public/" & filename)

  3. #3
    Utente bannato
    Registrato dal
    Jan 2003
    Messaggi
    2,407
    nada mi ridà lo stesso errore...

  4. #4
    Utente bannato
    Registrato dal
    Jan 2003
    Messaggi
    2,407
    non capisco proprio dove stia l'errore questa procedura l'ho utilizzata per l'upload di immagini e funziona, ora la sfruttoo per l'upload di file .pdf e mi da sto errore... ma perchè.... :master:

  5. #5
    Utente bannato
    Registrato dal
    Jan 2003
    Messaggi
    2,407
    nessuno ce mi possa aiutare??

  6. #6
    Utente bannato
    Registrato dal
    Jan 2003
    Messaggi
    2,407
    up

  7. #7
    Utente bannato
    Registrato dal
    Jan 2003
    Messaggi
    2,407
    se non risolvo questo problema sono bloccato

    ho provato a riprodurre questa procedura per l'upload di immagini come avevo già fatto e che sapevo funzionare e mi ripropone lo stesso errore...

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.