Visualizzazione dei risultati da 1 a 4 su 4
  1. #1

    Upload di baol safari e googleChrome

    Buongiorno,
    ho un modulo semplicissimo con un solo campo di tipo file che punta all'Upload_semplie.asp di baol.

    Funziona perfettamente con ie, firefox ed opera, non funziona affatto con Safari e google Chrome (browser che visualizzano solo il pulsante nelle input con type=file senza il campo di testo.)

    l'errore è il seguente:
    codice:
    Microsoft VBScript runtime error '800a0005'
    
    Invalid procedure call or argument: 'MidB'
    
    /Upload.asp, line 831
    la riga 831 recita:
    codice:
    ContentType = BinaryToString(MidB(RequestBin,1,Pos-1))
    la funzione che contiene la riga 831 è
    codice:
    		Private Function pUpLoad()
    		Dim index,elm,i,EndOfFile,arPosBeg(),arPosEnd(),arPosName(),SizeStream,nE,BytesToRead,Header ,arContent,ar,tmp
    		Dim PosBeg,PosEnd,Name,FileName,ContentType,StreamType,Boundary,Content,boundaryLen,boundaryPos,Pos,arV,fieldValue
    			If EnabledLog then CreateFolder iLogFolder
    			If iTotalBytes>0 then
    					If Request.ServerVariables("HTTP_CONTENT_TYPE")="application/x-www-form-urlencoded" then
    						Content = BinaryStringRead()
    						ar = split(Content,"&")
    						for each elm in ar
    							arV = split(elm,"=")
    							Index = URLDecode(arV(0))
    							on error resume next
    							FieldValue = URLDecode(arV(1))
    							on error goto 0
    							AddToForm Index,FieldValue
    						next
    					else
    						IsMultipart =  True
    						InitUploadFiles()
    						BinaryRead()
    						'**** Deteterminazione Boundary ****
    	
    						SizeStream = Stream.Size
    						RequestBin = Stream.Read(60)
    						PosBeg = 1:PosEnd = InstrB(PosBeg,RequestBin,c13b)
    						boundary = MidB(RequestBin,PosBeg,PosEnd-PosBeg)
    						boundaryLen = LenB(boundary):boundaryPos = 1
    	
    						'**** End OF File Position ****
    						EndOfFile = SizeStream - boundaryLen - 3
    	
    						'**** Salvataggio Posizione di Boundary *****
    						Stream.Position = 0
    						RequestBin = Stream.Read()
    						nE = -1:Pos = 1
    						do
    							PosBeg = InStrB(Pos,RequestBin,boundary)
    							if PosBeg>0 then
    								PosBeg = InStrB(PosBeg + boundaryLen,RequestBin,cName)
    								PosEnd = InstrB(PosBeg+1,RequestBin,boundary)
    								If PosEnd >0 then
    									nE = nE + 1
    									redim preserve arPosBeg(nE)
    									redim preserve arPosEnd(nE)
    									redim preserve arPosName(nE)
    									arPosBeg(nE) = PosBeg
    									arPosEnd(nE) = PosEnd
    									tmp = InStrB(PosBeg + 1,RequestBin,cContentType)
    									arPosName(Ne) = 0
    									If tmp<PosEnd then
    										arPosName(Ne) = tmp
    									end if
    									if arPosName(Ne) = 0 then
    										arPosName(Ne) = InStrB(PosBeg + 1,RequestBin,c13b) + 3
    									end if
    								end if
    								Pos  = PosEnd
    							end if
    						loop until Pos=EndOfFile
    						for i=0 to nE
    							FileName=""
    							Stream.Position = arPosBeg(i)-1
    							Header = Split(BinaryToString(Stream.Read(arPosName(i)-arPosBeg(i))),"; ")
    							if uBound(Header)>0 then
    								on error resume next
    								execute Header(0) & ":" & Header(1)
    								if err.number<>0 then
    									response.write err.description &"
    "
    									response.write Header(0) & ":" & Header(1)
    									response.end
    								end if
    								on error goto 0
    								If FileName<>"" then
    									Stream.Position = arPosName(i)-1
    									RequestBin = Stream.Read (60)
    									Pos = InStrB(1,RequestBin,c13b)
    									ContentType = BinaryToString(MidB(RequestBin,1,Pos-1))
    									arContent = Split(ContentType,": ")
    									ContentType = arContent (1)
    									StreamType=1 : If InStr(ContentType,"text/")>0 then StreamType=2
    									PosBeg = arPosName(i) + Pos + 2
    									Stream.Position = PosBeg
    									RequestBin = Stream.Read (arPosEnd(i)-PosBeg-3)
    									AddNewRs Name,FileName,ContentType,StreamType,RequestBin
    									if LoadFilesInForm then AddToForm Name,FileName
    								else
    									Form(Name) = ""
    								end if
    							else
    								Execute Header(0)
    								Stream.Position = arPosName(i)
    								RequestBin = Stream.Read(arPosEnd(i)-arPosName(i)-3)
    								AddToForm Name,BinaryToString(RequestBin)
    							end if
    						next
    						IsDataLoad = True
    						Stream.Close
    						MoveFirst
    						end if
    			End if
    		End function
    il file che provo ad uploadare non contiene caratteri speciali o altro....

  2. #2
    levando MidB trova un errore in BinaryToString

  3. #3
    nessuno? :master:

  4. #4
    per la cronaca, i file che danno errore sono gli flv.

    Avi ed Mpg vengono caricati correttamente

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.