<% ' Variables Dim mySmartUpload Dim file Dim intCount tempo=now() dd=right("0"&day(tempo),2) mm=right("0"&month(tempo),2) yy=right("0"&year(tempo),2) hh=right("0"&hour(tempo),2) mi=right("0"&minute(tempo),2) ss=right("0"&second(tempo),2) arquivo=yy&mm&dd&hh&mi&ss intCount=0 ' Object creation Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload") ' Upload mySmartUpload.Upload ' Select each file For each file In mySmartUpload.Files ' Only if the file exist If not file.IsMissing Then ' Save the files with his original names in a virtual path of the web server file.SaveAs("/upload/galeria/" & "TD"&arquivo&".jpg") ' sample with a physical path ' file.SaveAs("c:\temp\" & file.FileName) ' Display the properties of the current file Response.Write("Name = " & file.Name & "
") Response.Write("Size = " & file.Size & "
") Response.Write("FileName = " & file.FileName & "
") Response.Write("FileExt = " & file.FileExt & "
") Response.Write("FilePathName = " & file.FilePathName & "
") Response.Write("ContentType = " & file.ContentType & "
") Response.Write("ContentDisp = " & file.ContentDisp & "
") Response.Write("TypeMIME = " & file.TypeMIME & "
") Response.Write("SubTypeMIME = " & file.SubTypeMIME & "
") intCount = intCount + 1 End If Next ' Display the number of files which could be uploaded Response.Write("
" & mySmartUpload.Files.Count & " files could be uploaded.
") ' Display the number of files uploaded Response.Write(intCount & " file(s) uploaded.
") Set mySmartUpload = Nothing 'RESIZE Dim tamMax Dim mySmartImage Set mySmartImage= Server.CreateObject("aspSmartImage.SmartImage") ' From a JPEG file (virtual path) 'arquivo="12gggggg.jpg" mySmartImage.OpenFile "/upload/galeria/TD" & arquivo & ".jpg" OriginalWidth = mySmartImage.OriginalWidth OriginalHeight = mySmartImage.OriginalHeight response.write("largura="&OriginalWidth) response.write("
altura="&OriginalHeight) mySmartImage.Quality=80 tamMax=640 if (OriginalWidth>OriginalHeight ) then if (OriginalWidth>tamMax) then mySmartImage.Resample (tamMax), 0 end if else if (OriginalHeight>tamMax) then mySmartImage.Resample 0, (tamMax) end if end if mySmartImage.SaveFile "/upload/galeria/TD" & arquivo &".jpg" if (OriginalWidth>OriginalHeight ) then mySmartImage.Resample 150, 0 else mySmartImage.Resample 0,150 end if mySmartImage.SaveFile "/upload/thumbs/t_" & arquivo &".jpg" Response.Write("
http://www.timension.com.br/upload/galeria/TD" & arquivo &".jpg") Response.Write("
http://www.timension.com.br/upload/thumbs/t_" & arquivo &".jpg") Set mySmartImage = Nothing %>