Programalama > ASP

Etiketler: dosya, upload, etmek

Ort. 0
Puan ver:
<%@ Language=VBScript %>
<%

	dim totalbytes
	dim safearray
'upload.mdb dosyasi file dsn olarak tanimlanmali
'yada bir connection stringi ile baglanti kurulabilir
'Internet Guest Account (serverismi\IUSR_serverismi)kullanıcısına full yetki verilmeli
	if request.servervariables("REQUEST_METHOD") = "POST" then
	    set cnnl=server.CreateObject("ADODB.Connection")
		cnnl.Open "upload"
        set adtbl=server.CreateObject("ADODB.Recordset")
		adtbl.Open "files", cnnl, adOpenDynamic, adLockOptimistic

		set x = server.createobject("SCUpload.Upload")

		x.upload
						
		response.write "<br><br><br>FILE:<br>"
		
		for i = 1 to x.files.count
			for j = 1 to x.files(i).item.count
				response.write "   Path Name: " & x.files(i).item(j).pathname & "<br>"
				response.write "   File Size: " & x.files(i).item(j).size & "<br>"
				response.write "   Content Type: " & x.files(i).item(j).contenttype & "<br><br>"		
				x.files(i).item(j).save "c:\inetpub\wwwroot\raporlar"
				    adtbl.AddNew 
					adtbl("adi") = x.files(i).item(j).filename
					adtbl("tarih") = date()
					adtbl("lokasyon")="http:/raporlar/"&x.files(i).item(j).filename
					adtbl.update
			next 
		next 
		response.write "<br><br>"
		response.write "File Name: " & x.file("F1").filename & "<br>"
		
		adtbl.close
		cnnl.Close 		
	else
	
%>
<html>
<body bgColor=lightgrey>
<p align="center"> </p>
<p align="center"> </p>
<form method="post" enctype="multipart/form-data" action="upload.asp">
  <p align="center">                      

<TABLE border=0 cellPadding=1 cellSpacing=1 width="473" style="WIDTH: 473px; HEIGHT: 79px" bgColor=red>
  
  <TR>
    <TD><STRONG><FONT 
      color=white> DOSYA SEÇINIZ </FONT> </STRONG>   </TD>
    <TD>
   
  <input type="file" name="F1" style="WIDTH: 327px; HEIGHT: 22px"></TD>
    <TD></TD></TR>
  <TR>
    <TD></TD>
    <TD>
  <input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></TD>
    <TD></TD></TR></TABLE>
  <br> </p>
  <p align="center"> </p>
</form>
<p align="center"> </p>

<%
	end if
%>
</body>

</html>


Yorumlar                 Yorum Yaz
Bu hazır kod'a ilk yorumu siz yapın!
KATEGORİLER
ASP - 240
ASP.NET - 24
C# - 75
C++ - 174
CGI - 8
DELPHI - 247
FLASH - 49
HTML - 536
PASCAL - 246
PERL - 11
PHP - 160
WML - 9
XML - 2
Copyright © 2002 - 2024 Hazır Kod - Tüm Hakları Saklıdır.
Siteden yararlanırken gizlilik ilkelerini okumanızı tavsiye ederiz.
hazirkod.com bir İSOBİL projesidir.