inicio mail me! sindicaci;ón

ASP example: 6Travel code implementation uploads without package

At present a lot of upload without package kind, I looked probably, what write mostly is quite complex, some still can pass text version only unexpectedly the most crucial is to do not have 10 code the following: ) I was spent time studied night ADODB.Stream, and used 6 code came true to upload without package:

It is quotative content below: StrFileName = Request.QueryString(”file1″ )
Set ObjStream = Server.CreateObject(”ADODB.Stream” )ObjStream.Type = 1 ‘ AdTypeBinaryObjStream.OpenObjStream.LoadFromFile StrFileNameObjStream.SaveToFile Server. “123_onweb.gif” , 2

Use method:

Write the code above into Upload.asp

Input inside the browser:

Http://XXX/upload.asp? File1=c:\Upload file \123.gif

XXX is your lead plane address

Below the list that after be being carried out, you can see you much a 123_onweb.gif

He is you want a file to pull!

According to the principle we can expand the following code:

It is quotative content below:

Upload.asp file
<%
Function GetFileName(ByVal StrFile)
If StrFile <>”" Then
GetFileName = Mid(strFile, inStrRev(strFile, “\” ) 1)
Else
GetFileName = ” “
End If
End Function

StrFileName = Request.Form(”file1″ )
Set ObjStream = Server.CreateObject(”ADODB.Stream” )ObjStream.Type = 1 ‘ AdTypeBinaryObjStream.OpenObjStream.LoadFromFile StrFileNameObjStream.SaveToFile Server.MapPath(GetFileName(strFileName)) , 2ObjStream.Close
%>

Upload.htm file
<form Name= "FORM" Action= "upload.asp" Method= "post" >
<input Type= "submit" Name= "submit" Value= "OK" >
<input Type= "file" Name= "file1" Style= "width:400 ” Value= "" >
</form>

Bookmark:Digg Del.icio.us Reddit

Leave a Comment