% @ Language = VBScript %>
<%
Option Explicit
With Response
.Buffer = True
.Expires = 0
.Clear
End With
%>
<%dim das
Dim oFO, oProps, oFile, i, item, oMyName
Set oFO = New FileUpload
Response.Write("
DOSYA YÜKLEME
Dosya isimlerinin açiklayici olmasina dikkat ediniz. Örnek: manzara.jpg
")
Set oProps = oFO.GetUploadSettings
with oProps
.Extensions = Array("jpg", "gif", "psd") ' kabul edilen uzantılar
.UploadDirectory = Server.Mappath("db/resimupload/") ' dosyanın yükleneceği yer
.AllowOverWrite = true
.MaximumFileSize = 150000 ' yüklenmesini istediğiniz maksimum dosya büyüklüğü
.MininumFileSize = 1000 ' burada minimum dikkat ederseniz 1k 1000 diye yazılıyor
.UploadDisabled = false
End with
set oProps = nothing
oFO.ProcessUpload
if oFO.TotalFormCount > 0 then
if oFO.FileCount > 0 then
for i = 1 to oFO.FileCount
set oFile = oFO.File(i)
if oFile.ErrorMessage <> "" then
response.write "> HATA: " & _
oFile.ErrorMessage & "
"
else
oFile.SaveAsFile
if oFile.UploadSuccessful then
response.write "> Basariyla Yüklendi
"
response.write(" - Dosyanin su an bulunduğu URL: " & _
oFile.URLPath & "
")
response.write(" - Dosya tipi: " & oFile.ContentType & "
")
response.write(" - Dosya ismi: " & oFile.FileName & "
")%>
Kaydedilecek 2.el makinanın:
<%
response.write(" - Dosya boyutu: " & _
formatnumber(oFile.ByteCount, 0) & " byte
")
else
response.write "> Dosyayı yüklerken hata oluştu: " & _
oFile.ErrorMessage & "
"
end if
end if
set oFile = Nothing
next
else
response.write "> Daha önceden bu dosya ile ayni boyutta dosya yüklenmis. Bu durumda ayni dosyayi yüklüyor olabilirsiniz. Eger farkli bir dosya olduguna eminseniz; Dosya boyutunu büyültmek için küçük bir text dosyasini doldurarak zip'li dosyaya ekleyiniz."
end if
if oFO.FormCount > 0 then
if isarray(oFO.Inputs) then
for each item in oFO.Inputs
response.write " - Gönderen : " & oFO.Form(item) & "
"
next
end if
end if
else
oFO.ShowUploadForm request.servervariables("SCRIPT_NAME")
end if
set oFO = Nothing
%>