<% Dim qStrDir Dim qStrWin Dim targetis qStrDir=Request.QueryString("dir") qStrWin=Request.QueryString("win") targetis=Request.QueryString("targetis") %> <% Sub BuildUploadRequest(RequestBin) PosBeg = 1 PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(13))) if PosEnd = 0 then Response.Write "Form was submitted with no ENCTYPE=""multipart/form-data""
" Response.Write "Please correct the form attributes and try again." Response.End end if boundary = MidB(RequestBin,PosBeg,PosEnd-PosBeg) boundaryPos = InstrB(1,RequestBin,boundary) Do until (boundaryPos=InstrB(RequestBin,boundary & getByteString("--"))) Dim UploadControl Set UploadControl = CreateObject("Scripting.Dictionary") Pos = InstrB(BoundaryPos,RequestBin,getByteString("Content-Disposition")) Pos = InstrB(Pos,RequestBin,getByteString("name=")) PosBeg = Pos+6 PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(34))) Name = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg)) PosFile = InstrB(BoundaryPos,RequestBin,getByteString("filename=")) PosBound = InstrB(PosEnd,RequestBin,boundary) If PosFile<>0 AND (PosFile "") Then if UploadQueryString <> "" then AF_uploadAction = AF_uploadAction & "&" & UploadQueryString end if End If If (CStr(Request.QueryString("AF_upload")) <> "") Then AF_redirectPage = "success.asp" If (AF_redirectPage = "") Then AF_redirectPage = CStr(Request.ServerVariables("URL")) end if RequestBin = Request.BinaryRead(Request.TotalBytes) Dim UploadRequest Set UploadRequest = CreateObject("Scripting.Dictionary") BuildUploadRequest RequestBin AF_keys = UploadRequest.Keys for AF_i = 0 to UploadRequest.Count - 1 AF_curKey = AF_keys(AF_i) if UploadRequest.Item(AF_curKey).Item("FileName") <> "" then AF_value = UploadRequest.Item(AF_curKey).Item("Value") AF_valueBeg = UploadRequest.Item(AF_curKey).Item("ValueBeg") AF_valueLen = UploadRequest.Item(AF_curKey).Item("ValueLen") if AF_valueLen = 0 then Response.Write "

Đă có một lỗi xảy ra trong quá tŕnh bạn upload file!

" Response.Write "Tên File: " & Trim(AF_curPath) & UploadRequest.Item(AF_curKey).Item("FileName") & "
" Response.Write "File không tồn tại hoặc rỗng.
" Response.Write "Bạn vui ḷng kiểm tra và thử lại" response.End end if Dim AF_strm1, AF_strm2 Set AF_strm1 = Server.CreateObject("ADODB.Stream") Set AF_strm2 = Server.CreateObject("ADODB.Stream") AF_strm1.Open AF_strm1.Type = 1 'Binary AF_strm2.Open AF_strm2.Type = 1 'Binary AF_strm1.Write RequestBin AF_strm1.Position = AF_ValueBeg AF_strm1.CopyTo AF_strm2,AF_ValueLen AF_curPath = "../Nhac/Amthanh/MP3/" fname=UploadRequest.Item(AF_curKey).Item("FileName") on error resume next AF_strm2.SaveToFile Trim(Server.mappath(AF_curPath))& "\" & UploadRequest.Item(AF_curKey).Item("FileName"),2 if err then Response.Write "

Đă có một lỗi xảy ra trong quá tŕnh bạn upload file!

" Response.Write "Tên File: " & Trim(AF_curPath) & UploadRequest.Item(AF_curKey).Item("FileName") & "
" Response.Write "Thư mục để upload file vào không tồn tại hoặc không được phép upload file vào đó.
" Response.Write "Bạn vui ḷng kiểm tra và thử lại" err.clear response.End end if end if next If (AF_redirectPage <> "") Then %> <%response.buffer=true%> <% s="select *from FTP;" rs.open s,conn RS.MOVEFIRST %> <%DO WHILE NOT RS.EOF%> <% w=rs("nd") nd=w %> <% RS.MOVENEXT LOOP %> <% CONN.CLOSE SET CONN=NOTHING %> <%response.buffer=true%> Welcome + Tan Bach Khoa ONLINEMUSIC <% sq="select *from Theloai;" rs.open sq,conn rs.MOVEFIRST %>
     
     
 

 
  Trang Quản Trị

Tải File (Tập Tin) Lên SERVER Dùng FTP

 
 
Thêm Mới Bài Hát
Tên Bài :
Nhạc Sĩ : ">
Ca Sĩ TH : ">
Thể Loại :
Quá Trình UPLOAD Thành Công
     
  <%=Trim(Request.form("tb"))%>
 
<% end if Else if UploadQueryString <> "" then UploadQueryString = UploadQueryString & "&AF_upload=true" else UploadQueryString = "AF_upload=true" end if %>

Tải FILE Lên SERVER

File name:

 
Nhấn UPLOAD Để Tải Tập Tin Lên SERVER
   
<%End if%>