Smart Image Processor ASP 2 Support Product Page
Answered
I want to save resized img width and height in database
Asked 14 Dec 2011 09:30:09
2
have this question
14 Dec 2011 09:30:09 Ha ha posted:
My original image width and height is 1000X800I use SIP2.5.6 and Pure ASP File Upload 3.0.18
Question1
I install Pure ASP File Upload 3.0.18
but the code show "Pure ASP File Upload 3.0.17"
is Right???
Question2
I want to save resized img width and height in database
Not orignal width and height
How to do change my code?
<code>
<%
'*** Pure ASP File Upload 3.0.17
' Process form upload1
Dim pau, DMX_uploadAction, UploadRequest, UploadQueryString, pau_thePath, pau_nameConflict, pau_saveWidth, pau_saveHeight
Set pau = new PureUpload
pau.ScriptLibrary = "../../ScriptLibrary"
pau.TimeOut = 10000
pau.ConflictHandling = "uniq"
pau.StoreType = "file"
pau.ProgressTemplate = "circle.htm"
pau.ProgressWidth = 500
pau.ProgressHeight = 150
pau.UploadFolder = """../../DB/news_u/temp"""
pau.Required = true
pau.AllowedExtensions = "JPG,JPEG" ' "images"
pau.MaxFileSize = 20000
pau.MinWidth = 1
pau.MinHeight = 1
pau.MaxWidth = 4000
pau.MaxHeight = 4000
pau.ProcessUpload
pau.SaveAll
if pau.Done then
SetUploadFormRequest "w",pau.Fields("Filedata".Width
pau_saveWidth = "w"
SetUploadFormRequest "h",pau.Fields("Filedata".Height
pau_saveHeight = "h"
SetUploadFormRequest "n",pau.Fields("Filedata".FileName
SetUploadFormRequest "upid",Request.Cookies("an_newupid"
end if
pau.RedirectUrl = "add_upimg.asp?a="&tp_upimg
%>
<%
' *** Rename Uploaded Files 1.8.1
If (CStr(Request.QueryString("GP_upload") <> "" Then
Dim REUF_renameMask
REUF_renameMask = tp_upimg&"_##name##.##ext##"
RenameUploadedFiles pau_thePath, pau_nameConflict, REUF_renameMask
end if
%>
<%
' Smart Image Processor 2.5.6
Dim s3
Set s3 = New ImageProcessor
s3.Key = "54F4F771-61F5-42DB-BDBA-236818764F4A"
s3.ScriptFolder = "../../ScriptLibrary"
s3.Component = "Auto"
s3.Source = "upload"
s3.AutoOrient = false
s3.KeepMetaData = false
s3.Matte = "#FFFFFF"
s3.UploadFields = ""
s3.GetFiles
While s3.HasFiles
s3.LoadFromSource
s3.ResizeEx 600, 550, true, false
s3.FontFamily = "Kartika"
s3.FontSize = 12
s3.FontColor = "#CCCCCC"
s3.Bold = false
s3.Italic = false
s3.Underline = false
s3.AddText "HHH","Bottom-Right"
s3.Overwrite = false
s3.Mask = "##path##../s3/##name##.jpg"
s3.SaveJPEG 100
s3.MoveNext
Wend
Set s3 = Nothing
%>
</code>
Edited by - CHEN SHAO-KAI on 14 Dec 2011 09:35:46
Official Answer
Replied 14 Dec 2011 12:50:56
Please read the following article: www.dmxzone.com/go?15914
Replies
Replied 14 Dec 2011 12:50:56
14 Dec 2011 12:50:56 Teodor Kuduschiev replied:
Please read the following article: www.dmxzone.com/go?15914
Replied 14 Dec 2011 13:21:23
14 Dec 2011 13:21:23 Vulcho Vulev replied:
Can you also test the following code :
<%
'*** Pure ASP File Upload 3.0.17
' Process form upload1
Dim pau, DMX_uploadAction, UploadRequest, UploadQueryString, pau_thePath, pau_nameConflict, pau_saveWidth, pau_saveHeight
Set pau = new PureUpload
pau.ScriptLibrary = "../../ScriptLibrary"
pau.TimeOut = 10000
pau.ConflictHandling = "uniq"
pau.StoreType = "file"
pau.ProgressTemplate = "circle.htm"
pau.ProgressWidth = 500
pau.ProgressHeight = 150
pau.UploadFolder = """../../DB/news_u/temp"""
pau.Required = true
pau.AllowedExtensions = "JPG,JPEG" ' "images"
pau.MaxFileSize = 20000
pau.MinWidth = 1
pau.MinHeight = 1
pau.MaxWidth = 4000
pau.MaxHeight = 4000
pau.ProcessUpload
pau.SaveAll
%>
<%
' *** Rename Uploaded Files 1.8.1
If (CStr(Request.QueryString("GP_upload" <> "" Then
Dim REUF_renameMask
REUF_renameMask = tp_upimg&"_##name##.##ext##"
RenameUploadedFiles pau_thePath, pau_nameConflict, REUF_renameMask
end if
%>
<%
' Smart Image Processor 2.5.6
Dim s3
Set s3 = New ImageProcessor
s3.Key = "54F4F771-61F5-42DB-BDBA-236818764F4A"
s3.ScriptFolder = "../../ScriptLibrary"
s3.Component = "Auto"
s3.Source = "upload"
s3.AutoOrient = false
s3.KeepMetaData = false
s3.Matte = "#FFFFFF"
s3.UploadFields = ""
s3.GetFiles
While s3.HasFiles
s3.LoadFromSource
s3.ResizeEx 600, 550, true, false
s3.FontFamily = "Kartika"
s3.FontSize = 12
s3.FontColor = "#CCCCCC"
s3.Bold = false
s3.Italic = false
s3.Underline = false
s3.AddText "HHH","Bottom-Right"
s3.Overwrite = false
s3.Mask = "##path##../s3/##name##.jpg"
s3.SaveJPEG 100
s3.MoveNext
Wend
Set s3 = Nothing
Set sip1 = Nothing
if pau.Done then
SetUploadFormRequest "w",pau.Fields("Filedata".Width
pau_saveWidth = "w"
SetUploadFormRequest "h",pau.Fields("Filedata".Height
pau_saveHeight = "h"
SetUploadFormRequest "n",pau.Fields("Filedata".FileName
SetUploadFormRequest "upid",Request.Cookies("an_newupid"
end if
%>
<%
'*** Pure ASP File Upload 3.0.17
' Process form upload1
Dim pau, DMX_uploadAction, UploadRequest, UploadQueryString, pau_thePath, pau_nameConflict, pau_saveWidth, pau_saveHeight
Set pau = new PureUpload
pau.ScriptLibrary = "../../ScriptLibrary"
pau.TimeOut = 10000
pau.ConflictHandling = "uniq"
pau.StoreType = "file"
pau.ProgressTemplate = "circle.htm"
pau.ProgressWidth = 500
pau.ProgressHeight = 150
pau.UploadFolder = """../../DB/news_u/temp"""
pau.Required = true
pau.AllowedExtensions = "JPG,JPEG" ' "images"
pau.MaxFileSize = 20000
pau.MinWidth = 1
pau.MinHeight = 1
pau.MaxWidth = 4000
pau.MaxHeight = 4000
pau.ProcessUpload
pau.SaveAll
%>
<%
' *** Rename Uploaded Files 1.8.1
If (CStr(Request.QueryString("GP_upload" <> "" Then
Dim REUF_renameMask
REUF_renameMask = tp_upimg&"_##name##.##ext##"
RenameUploadedFiles pau_thePath, pau_nameConflict, REUF_renameMask
end if
%>
<%
' Smart Image Processor 2.5.6
Dim s3
Set s3 = New ImageProcessor
s3.Key = "54F4F771-61F5-42DB-BDBA-236818764F4A"
s3.ScriptFolder = "../../ScriptLibrary"
s3.Component = "Auto"
s3.Source = "upload"
s3.AutoOrient = false
s3.KeepMetaData = false
s3.Matte = "#FFFFFF"
s3.UploadFields = ""
s3.GetFiles
While s3.HasFiles
s3.LoadFromSource
s3.ResizeEx 600, 550, true, false
s3.FontFamily = "Kartika"
s3.FontSize = 12
s3.FontColor = "#CCCCCC"
s3.Bold = false
s3.Italic = false
s3.Underline = false
s3.AddText "HHH","Bottom-Right"
s3.Overwrite = false
s3.Mask = "##path##../s3/##name##.jpg"
s3.SaveJPEG 100
s3.MoveNext
Wend
Set s3 = Nothing
Set sip1 = Nothing
if pau.Done then
SetUploadFormRequest "w",pau.Fields("Filedata".Width
pau_saveWidth = "w"
SetUploadFormRequest "h",pau.Fields("Filedata".Height
pau_saveHeight = "h"
SetUploadFormRequest "n",pau.Fields("Filedata".FileName
SetUploadFormRequest "upid",Request.Cookies("an_newupid"
end if
%>
Replied 15 Dec 2011 11:40:24
15 Dec 2011 11:40:24 Ha ha replied:
yes I put my code like this
but no effect
also new record width & height 2500x1800 in my database
It is so strange.......
and I have try anything I can do
also no effect
can you show me the correct example or asp code ?
maybe I was something mistake
Replied 16 Dec 2011 18:08:02
16 Dec 2011 18:08:02 Ha ha replied:
can anybody help me?
Replied 23 Jan 2012 12:25:53
23 Jan 2012 12:25:53 Teodor Kuduschiev replied:
Please check the article that i've pasted a link to.