<html> <head> <title>ThaiCreate.Com ASP & aspSmartUpload</title> </head> <body> <form action="AspSmartUpload6.asp" method="post" enctype="multipart/form-data" name="frmMain"> Fullname <input name="txt1" type="text"><br> Upload 1 <input name="file1" type="file"><br> Upload 2 <input name="file2" type="file"> <input type="submit" name="Submit" value="Submit"> </form> </body> </html>
<% Option Explicit %> <html> <head> <title>ThaiCreate.Com ASP & aspSmartUpload</title> </head> <body> <% Dim mySmartUpload '*** Create Object ***' Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload") '*** Upload Files ***' mySmartUpload.Upload '*** input and other element ***' Response.write("Fullname= "&mySmartUpload.Form("txt1")&"<br>") '*** Upload file1 ***' If mySmartUpload.Files("file1").FileName <> "" Then mySmartUpload.Files("file1").SaveAs(Server.MapPath("MyFiles/" & mySmartUpload.Files("file1").FileName)) Response.write mySmartUpload.Files("file1").Name & " Uploaded.<br>" End If '*** Upload file2 ***' If mySmartUpload.Files("file2").FileName <> "" Then mySmartUpload.Files("file2").SaveAs(Server.MapPath("MyFiles/" & mySmartUpload.Files("file2").FileName)) Response.write mySmartUpload.Files("file2").Name & " Uploaded.<br>" End IF '*** Properties ***' 'Response.Write("Name = " & mySmartUpload.Files("file1").Name & "<BR>") 'Response.Write("Size = " & mySmartUpload.Files("file1").Size & "<BR>") 'Response.Write("FileName = " & mySmartUpload.Files("file1").FileName & "<BR>") 'Response.Write("FileExt = " & mySmartUpload.Files("file1").FileExt & "<BR>") 'Response.Write("FilePathName = " & mySmartUpload.Files("file1").FilePathName & "<BR>") 'Response.Write("ContentType = " & mySmartUpload.Files("file1").ContentType & "<BR>") 'Response.Write("ContentDisp = " & mySmartUpload.Files("file1").ContentDisp & "<BR>") 'Response.Write("TypeMIME = " & mySmartUpload.Files("file1").TypeMIME & "<BR>") 'Response.Write("SubTypeMIME = " & mySmartUpload.Files("file1").SubTypeMIME & "<BR>") Set mySmartUpload = Nothing %> </body> </html>
ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท