التنبيهات التالية ظهرت :
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 864 - File: showthread.php PHP 7.4.33 (Linux)
File Line Function
/showthread.php 864 errorHandler->error



تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
تطبيق منقول - عمل Uplodad من خلال ASP
#1
كاتب الموضوع : AhmedEssawy


كود :
[align=left][i][COLOR=#000080]<!--
Form Based File Upload Using Pure ASP
'**************************************
' Name: Form Based File Upload Using Pur
' e ASP
' Description:<b>[/COLOR]This code will al
' low you to do form based file uploads[COLOR=#000080]<
' ;/b>. It supports multiple files and
' uses only pure ASP. It will parse form d
' ata, browse server folders for a save lo
' cation, and log uploads or failed upload
' s into a database There are no component
' s to install so it will work on any web
' server that supports ASP. Just paste thi
' s code into a text file and name it save
' any.asp. I have tested it on IIS 4 and 5
' , with IE 4, IE 5 and Netscape 6. With t
' his code you will be able to save a file
' in any directory that the anonymous acco
' unt assigned to it (usually IUSER_machin
' ename) has access to so be careful. I sh
' ould note that the server needs ADO, ADO
' X and the File System Object installed o
' n it.
' By: Karl P. Grear
'
'This code is copyrighted and has limited warranties.Please see
' http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=6569&lngWId=4
'for details.
'**************************************
-->[/COLOR][/i]
<%response.buffer=false
Func = Request("Func")
if isempty(Func) Then
Func = 1
End if
Select Case Func
Case 1
'You do not need to use this form to
'send your files.
BrowseServer = Request.Form("BrowseServer")
%>
<H2>File Upload Form.</H2>
<TABLE>

<FORM ENCTYPE=[color=#0000ff]"multipart/form-data"[/color] ACTION=[color=#0000ff]"saveany.asp?func=2"[/color] METHOD=POST id=form1 name=form1>
<TR><TD><STRONG>Debug Options.</STRONG><BR></TD></TR>
<TR><TD><INPUT NAME=Options TYPE=CheckBox Value='Raw'>Create Raw File<BR></TD></TR>
<TR><TD><INPUT NAME=Options TYPE=CheckBox Value='Boundry'>Create Boundry File<BR><BR></TD></TR>
<TR><TD><STRONG>Hit the [Browse Server] button to find the folder on the server to upload to.</STRONG><BR></TD></TR>
<TR><TD><INPUT NAME=ServerPath SIZE=30 TYPE=Text value='<%= BrowseServer %>'>[color=#ff8000]<INPUT type=button value=[COLOR=#0000ff]"Browse Server"[/color] onclick=[color=#0000ff]"document.location='saveany.asp?func=3'"[/color] id=button1 name=button1>[/COLOR][color=#000080]<BR>[/color][color=#000080]<BR>[/color][color=#008080]</TD>[/color][color=#008080]</TR>[/color]
[color=#008080]<TR>[/color][color=#008080]<TD>[/color][color=#000080]<STRONG>[/color]Hit the [Browse] button to find the file on your computer.[color=#000080]</STRONG>[/color][color=#000080]<BR>[/color][color=#008080]</TD>[/color][color=#008080]</TR>[/color]
[color=#008080]<TR>[/color][color=#008080]<TD>[/color][color=#ff8000]<INPUT NAME=File1 SIZE=30 TYPE=file>[/color][color=#000080]<BR>[/color][color=#008080]</TD>[/color][color=#008080]</TR>[/color]
[color=#008080]<TR>[/color][color=#008080]<TD>[/color][color=#ff8000]<INPUT NAME=File2 SIZE=30 TYPE=file>[/color][color=#000080]<BR>[/color][color=#008080]</TD>[/color][color=#008080]</TR>[/color]
[color=#008080]<TR>[/color][color=#008080]<TD>[/color][color=#ff8000]<INPUT NAME=File3 SIZE=30 TYPE=file>[/color][color=#000080]<BR>[/color][color=#000080]<BR>[/color][color=#008080]</TD>[/color][color=#008080]</TR>[/color]
[color=#008080]<TR>[/color][color=#008080]<TD>[/color][color=#000080]<STRONG>[/color]Enter security password.[color=#000080]<STRONG>[/color][color=#000080]<BR>[/color][color=#008080]</TD>[/color][color=#008080]</TR>[/color]
[color=#008080]<TR>[/color][color=#008080]<TD>[/color][color=#ff8000]<INPUT NAME=Password SIZE=30 TYPE=Text>[/color][color=#000080]<BR>[/color][color=#008080]</TD>[/color][color=#008080]</TR>[/color]
[color=#008080]<TR>[/color][color=#008080]<TD>[/color][color=#000080]<STRONG>[/color]Comments[color=#000080]<STRONG>[/color][color=#000080]<BR>[/color][color=#008080]</TD>[/color][color=#008080]</TR>[/color]
[color=#008080]<TR>[/color][color=#008080]<TD>[/color][color=#ff8000]<TEXTAREA name=TArea cols=35 rows=5>[/color]Enter Comments Here[color=#ff8000]</TEXTAREA>[/color][color=#000080]<BR>[/color][color=#008080]</TD>[/color][color=#008080]</TR>[/color]
[color=#008080]<TR>[/color][color=#008080]<TD align=left>[/color][color=#ff8000]<INPUT name=submit type=[COLOR=#0000ff]"submit"[/color] value=[color=#0000ff]"Upload File"[/color]>[/COLOR][color=#000080]<BR>[/color][color=#000080]<BR>[/color][color=#008080]</TD>[/color][color=#008080]</TR>[/color]
[color=#008080]<TR>[/color][color=#008080]<TD>[/color]NOTE: Please be patient, you will not receive any notification until the file is completely transferred.[color=#000080]<BR>[/color][color=#000080]<BR>[/color][color=#008080]</TD>[/color][color=#008080]</TR>[/color]
[color=#ff8000]</FORM>[/color]
[color=#008080]</TABLE>[/color]
[COLOR=#000080]<%
Case 2
Server.ScriptTimeout=300
ForWriting = 2
adLongVarChar = 201
lngNumberUploaded = 0
'Create a database connection
Set conn = server.createobject("adodb.connection")
'Create a recordset
Set rstLog = server.createobject("adodb.recordset")
On Error Resume Next
'Open the connection
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\inetpub\UploadLog.mdb;Persist Security Info=False"
if err.number = "-2147467259" Then
'the database is missing create it
CreateDatabase
Response.Write "Create Database"
'reopen the connetion
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\inetpub\UploadLog.mdb;Persist Security Info=False"
err.clear
End if
'Open recordset
rstLog.Open "Select * from Logs", conn, 3, 3, 1
'Get binary data from form
noBytes = Request.TotalBytes
binData = Request.BinaryRead (noBytes)
'convery the binary data to a string
Set RST = CreateObject("ADODB.Recordset")
LenBinary = LenB(binData)
if LenBinary >[/COLOR] 0 Then
RST.Fields.Append "myBinary", adLongVarChar, LenBinary
RST.Open
RST.AddNew
RST("myBinary").AppendChunk BinData
RST.Update
strDataWhole = RST("myBinary")
End if

'get the boundry indicator
strBoundry = Request.ServerVariables ("HTTP_CONTENT_TYPE")
lngBoundryPos = instr(1,strBoundry,"boundary=") + 8
strBoundry = "--" & right(strBoundry,len(strBoundry)-lngBoundryPos)
'ParseForm returns a dictionary object
'You can ParseForm any time after the
'Boundry indicator is set.
Set dPassword = ParseForm("Password")
Set dOptions = ParseForm("Options")
'both of these are valid
Response.Write ParseForm("Password").item(0) & "[color=#000080]<BR>[/color]"
Response.write dPassword.item(0) & "[color=#000080]<BR>[/color]"
'Just write the data In the TArea
response.Write ParseForm("TArea").item(0) & "[color=#000080]<BR>[/color]"
SavePath = ParseForm("ServerPath").item(0)
if SavePath = "" or isempty(SavePath) Then
Response.Write "[color=#000080]<H2>[/color] The following Error occured.[color=#000080]</H2>[/color]"
Response.Write "You did Not enter a server path To save your file to."
Response.Write "[color=#000080]<BR>[/color][color=#000080]<BR>[/color]Hit the back button, make the needed corrections and resubmit your information."
Response.Write "[color=#000080]<BR>[/color][color=#000080]<BR>[/color][color=#ff8000]<INPUT type='button' onclick='history.go(-1)' value='<< Back' id='button'1 name='button'1>[/color]"
Response.End
End if
intCount = dOptions.count
if intCount > 0 Then
For x = 0 To intCount
Select Case dOptions.item(x)
Case "Raw"
Raw = True
Case "Boundry"
Boundry = True
End Select
Next
Else
Raw = False
Boundry = False
End if
if dPassword.item(0) <> "oktosend" Then
'Log invalid attempt To log file.
rstLog.AddNew
'Log the Date and time, the IP, the Path
rstLog(0) = Now()
rstLog(1) = request.ServerVariables("REMOTE_ADDR")
rstLog(2) = SavePath
rstLog(3) = "Invalid Logon"
rstLog.Update
Response.Write "[color=#000080]<H2>[/color] The following Error occured.[color=#000080]</H2>[/color]"
Response.Write "The Password you entered is invalid."
Response.Write "[color=#000080]<BR>[/color][color=#000080]<BR>[/color]Hit the back button, make the needed corrections and resubmit your information."
Response.Write "[color=#000080]<BR>[/color][color=#000080]<BR>[/color][color=#ff8000]<INPUT type='button' onclick='history.go(-1)' value='<< Back' id='button'1 name='button'1>[/color]"
Response.End
End if


[/align]
يتبع ...
}}}
تم الشكر بواسطة:


الردود في هذا الموضوع
تطبيق منقول - عمل Uplodad من خلال ASP - بواسطة Raggi Tech - 17-10-12, 10:42 PM


التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم