<% Response.ContentType = "text/html" Response.Charset = "UTF-8" %> <% Function ChangeTR(ByVal Pic) Pic = Replace(Pic,"","s") Pic = Replace(Pic,"","g") Pic = Replace(Pic,"","i") Pic = Replace(Pic,"","u") Pic = Replace(Pic,"","o") Pic = Replace(Pic,"","c") Pic = Replace(Pic,"'","") Pic = Replace(Pic,"&","") Pic = Replace(Pic,"","G") Pic = Replace(Pic,"","U") Pic = Replace(Pic,"","O") Pic = Replace(Pic,"","C") Pic = Replace(Pic,"","S") Pic = Replace(Pic,"","I") Pic = Replace(Pic," ","") ChangeTR = Pic End Function '******** RasgeleNumara ********** Function CRefNum() strValue = Empty strValue = strValue & Year(Date) If Len(Month(Date)) = 1 Then strValue = strValue & "0" & Month(Date) Else strValue = strValue & Month(Date) End If If Len(Day(Date)) = 1 Then strValue = strValue & "0" & Day(Date) Else strValue = strValue & Day(Date) End If If Len(Hour(Time)) = 1 Then strValue = strValue & "_0" & Hour(Time) Else strValue = strValue & "_" & Hour(Time) End If If Len(Minute(Time)) = 1 Then strValue = strValue & "0" & Minute(Time) Else strValue = strValue & Minute(Time) End If If Len(Second(Time)) = 1 Then strValue = strValue & "0" & Second(Time) Else strValue = strValue & Second(Time) End If dim r randomize() r=rnd(10)+1 if r=1 then 'response.write(r) elseif r=2 then response.write(r) elseif r=10 then 'response.write(r) else 'response.write(r) end if Num=Replace(R,",","") CRefNum = Num End Function '******** RasgeleNumara ********** Tur = Request.QueryString("Tur") text = Request.QueryString("text") PathDir ="C:\Inetpub\vhosts\altinates.com.tr\httpdocs\Assets\" 'Response.Write(PathDir) 'Response.End() Tip = Left(text,2) Select Case Tip Case "Ku" ResYol = PathDir & "Images/" Case "ic" ResYol = PathDir & "Images/" Case "So" ResYol = PathDir & "Images/" Case "Fo" ResYol = PathDir & "Images/" Case "Us" ResYol = PathDir & "Images/" Case "Sm" ResYol = PathDir & "Images/" Case "Me" ResYol = PathDir & "Images/" Case "Im" ResYol = PathDir & "Images/" End Select %> <% Set UPLOAD = Server.CreateObject("PERSITS.UPLOAD" ) UPLOAD.OVERWRITEFILES = FALSE COUNT = UPLOAD.SAVETOMEMORY For Each FILE IN UPLOAD.FILES ' Kontroller sadace resim trevi dosya formatlar iin eer .zip' e izin vermek istiyorsanz : If FILE.EXT<>".zip" End If bu kudu bu alan yazarsanz .zip harici dosyalar aadaki konttoller tabi olucak FILE.IMAGEtype="UNKNOWN" ile asp ve benzeri kt niyetli dosyalarn yklenmesine ayrca izin verilmez.. '----------------------------------------- If FILE.IMAGEtype="UNKNOWN" Then With Response .Write"" End with FILE.DELETE RESPONSE.End ' resim trevi dosya kontrolleri bitti, eer yukardaki gibi .zip iin verdiimiz rnei yapld ise buraya End If koyunuz. ElseIf FILE.SIZE > 2100000 Then With Response .Write"" End with FILE.DELETE Response.End End If ' Dosya ad uzantlar '----------------------------------------- DOSYUZANTI=FILE.EXT ' dosyann uzantsna bakyoruz. (.jpg .gIf .asp .zip rnei gibi balarnda nokta bulunur. ) DOSYAADI="" ' Denemek iin Deneme olarak belirttik.. isterseniz form dan gelen bir isim veya id de olabilir : DOSYAADI=Trim(UPLOAD.FORM("ID" )) If DOSYAADI="" Then ' Eer dosya ad bosa orjinal dosya adn alcak. DOSYAADI = left(FILE.Filename,(Len(FILE.Filename)-4)) End If ' Ykleme yeri '------------------------------------- ' Fiziksel yol ile ' DOSYAPATH="c:\dosyalar\xxxxx\" ' sona \ yazmay unutmayn yoksa hata veriri dosyan system32 dizini iine gidebilir. ' PATH = ( DOSYAPATH &DOSYAADI &DOSYUZANTI) ' orjinal dosya ad iin FILE.NAME &FILE.EXT denebilir. ' FILE.SAVEAS PATH '------------------------------------- ' Dorudan bulunduu dizine DosyaAd = ChangeTR(DOSYAADI) DosyaAdi = DosyaAd & ""& CRefNum() &""& CRefNum() & DOSYUZANTI PATH = ResYol & DosyaAdi ' hata verirse yklemez ise Server.MapPath( "\" &DOSYAADI &DOSYUZANTI) 'Response.Write PATH 'response.End FILE.SAVEAS PATH ' ayrca araya dizin ekleyebilirsiniz. PATH = Server.MapPath( "images\" DOSYAADI &DOSYUZANTI) '------------------------------------- Next DosyaAdi_K = DosyaAd & "_" & CRefNum() & "_k" & DOSYUZANTI text_k = text & "_K" Select Case Tur Case "1" Call OPTIMIZE Case "2" Call OPTIMIZE Case "Kroki" Call OPTIMIZE3 Case "SitePlan" Call OPTIMIZE4 End Select %> <% Sub OPTIMIZE Set JPEG1 = Server.CreateObject("PERSITS.JPEG" ) Set JPEG2 = Server.CreateObject("PERSITS.JPEG" ) JPEG1.Open PathDir & "150X150.png" ' Hazrladmz bo resim JPEG2.Open ResYol & DosyaAdi JPEG2.PRESERVEASPECTRATIO = TRUE ' REsmin Orantl bir ekilde klmesini ya da bymesini salyor. If JPEG2.OriginalWidth > 200 Then JPEG2.WIDTH = 200 End IF JPEG2.SAVE ResYol & DosyaAdi_K End Sub Sub OPTIMIZE2 Set JPEG1 = Server.CreateObject("PERSITS.JPEG" ) Set JPEG2 = Server.CreateObject("PERSITS.JPEG" ) JPEG1.Open PathDir & "150X150.png" ' Hazrladmz bo resim JPEG2.Open ResYol & DosyaAdi JPEG2.PRESERVEASPECTRATIO = TRUE ' REsmin Orantl bir ekilde klmesini ya da bymesini salyor. If JPEG2.OriginalWidth > 196 Then JPEG2.WIDTH = 196 End IF JPEG2.SAVE ResYol & DosyaAdi_K End Sub Sub OPTIMIZE3 Set JPEG2 = Server.CreateObject("PERSITS.JPEG" ) JPEG2.Open ResYol & DosyaAdi JPEG2.PRESERVEASPECTRATIO = TRUE ' REsmin Orantl bir ekilde klmesini ya da bymesini salyor. If JPEG2.OriginalWidth > 500 Then JPEG2.WIDTH = 500 End IF JPEG2.SAVE ResYol & DosyaAdi_K End Sub Sub OPTIMIZE4 Set JPEG2 = Server.CreateObject("PERSITS.JPEG" ) JPEG2.Open ResYol & DosyaAdi JPEG2.PRESERVEASPECTRATIO = TRUE ' REsmin Orantl bir ekilde klmesini ya da bymesini salyor. If JPEG2.OriginalHeight > 300 Then JPEG2.Height = 300 End IF JPEG2.SAVE ResYol & DosyaAdi_K End Sub %>



İşleminiz gerçekleştirilmiştir.
KAPAT