İyinet'e Hoşgeldiniz!

Türkiye'nin En Eski Webmaster Forum'una Hemen Kayıt Olun!

Kayıt Ol!

ASP Dosya yükleme (file upload)

SeLCuK's

0
İyinet Üyesi
Katılım
27 Mart 2013
Mesajlar
118
Reaction score
0
Konum
Adana
Kod:
<html>
<head>
<title>ASP File Upload</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9">
</head>

<body>

<%
if Request.QueryString("islem")="yukle" Then

 Server.ScriptTimeout=120
 ' *** Upload File
Set Upload = Server.CreateObject("Persits.Upload")

'  *** Dosya boyutu için sınır koyuluyor.
	Upload.SetMaxSize 10000000, True
	Upload.Save
 
 ' *** Body bölümü
strBody = "Gönderilme Tarihi : " & now & VbCrLf  & VBCrLf

For Each Item in Upload.Form
  strBody = strBody & Item.Name& ":" &  Item.Value & VBCrLf  & VBCrLf
Next
 
'  Path	
pt="c:\upload"
			
ffileexist=0
			
For Each File in Upload.Files		
		ffileexist=1
		fname=File.FileName
		File.SaveAs pt & "\" & File.FileName		
Next
		
strTo = "[email protected]"  
strFrom ="[email protected]"
strSubject="Form doldurularak dosya gönderme"


Set myMail=CreateObject("CDO.Message")
	myMail.Subject=strSubject
	myMail.From=strFrom
	myMail.To=strTo
	myMail.TextBody=strBody
	if ffileexist=1 then
		newpt= pt & "\" & fname2
		myMail.AddAttachment newpt
	end if
	myMail.Send
	set myMail=nothing

else
	
%>

<form action="upload.asp?islem=yukle" name="form1" id="form1" method="post" ENCTYPE="multipart/form-data">
First name : <input name="FirstName" type="text" class="inputborder" id="First_Name" size="25"><br>
Surname : <input name="Surname" type="text" class="inputborder" id="Surname" size="25"><br>
Contact number :<input name="Contact" type="text" class="inputborder" id="Contact" size="25"><br>
File : <input type="file" class="inputborder" id="CV" name="CV" size="25">                   
<input name="Submit" type="button" onClick="javascript:formsubmit()" value="Submit" >
</form>

<% end if %>

</body>
</html>
 

Türkiye’nin ilk webmaster forum sitesi iyinet.com'da forum üyeleri tarafından yapılan tüm paylaşımlardan; Türk Ceza Kanunu’nun 20. Maddesinin, 5651 Sayılı Kanununun 4. maddesinin 2. fıkrasına göre, paylaşım yapan üyeler sorumludur.

Backlink ve Tanıtım Yazısı için iletişime geçmek için Skype Adresimiz: .cid.1580508955483fe5

Üst