İçeriğe atla
Bilal Demir
  • 2 dk okuma
  • 1180 görüntülenme
ASP Dosya yükleme (file upload)
<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 = "user@websitesi.com"

strFrom ="user@websitesi.com"

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>

Yorumlar

Henüz yorum yok.

Yorum Yaz

Yorumlar onaylandıktan sonra yayımlanır.
Bu sitede çerez var

Deneyiminizi iyileştirmek için birkaç küçük çerez kullanıyorum. Ayrıntılı bilgi

Hoş geldiniz!

Hoş geldiniz!

1 Aralık 2026 · bilaldemir.com yayında

Sözümü tuttum.

Yıllardır “Web sitemi de bir aralık yapacağım.” diyordum. “Bir aralık yaparım” dedim, 1 Aralık’ta yaptım.

Altı bölümün kapıları açık:

Keyifli gezintiler. Bilal Demir