Forums

ASP

This topic is locked

Resize after rename problem

Posted 04 Dec 2006 21:48:31
1
has voted
04 Dec 2006 21:48:31 Charles Harford posted:
I cannot seem to get Smart Image Processor to work after applying the Add on pack Rename Behaviour.

I'm using:
Pure Upload ASP 3.0.5
AddOn Pack 1.7.2
Smart Image Processor 2.0.2

I have applied the behaviours in that order on the page.

I get the following error:

An invalid '/' or '\' was found in the Path parameter for the MapPath method.
/wtg/admin/ScriptLibrary/incSIP2Class.asp, line 442

If I remove the rename behaviour the resize function works.


I would be very, very grateful if anyone has any suggestions as this is driving me crazy.

Many thanks in advance.

p.s. I have tried changing the destination [pau.UploadFolder ] to "dbimages". I wondered if having a directory switch in the path may be causing the problem but it does not make any difference.


Below is the code block:

<!--#include file="ScriptLibrary/incSIP2Class.asp" -->
<!--#include file="ScriptLibrary/incPU3Class.asp" -->
<!--#include file="ScriptLibrary/incPU3Utils.asp" -->
<!--#include file="ScriptLibrary/incPUAddOn.asp" -->
<%
'*** Pure ASP File Upload 3.0.5
' Process form Upload
Dim pau, DMX_uploadAction, UploadRequest, UploadQueryString, pau_thePath, pau_nameConflict, pau_saveWidth, pau_saveHeight
Set pau = new PureUpload
pau.ScriptLibrary = "ScriptLibrary"
pau.ConflictHandling = "over"
pau.StoreType = "file"
pau.UploadFolder = """../dbimages"""
pau.AllowedExtensions = "GIF,JPG,JPEG,BMP,PNG" ' "images"
pau.MaxFileSize = 5128
pau.ProcessUpload
pau.SaveAll
%>
<%
' *** Rename Uploaded Files 1.7.2
If (CStr(Request.QueryString("GP_upload") <> "" Then
Dim REUF_renameMask
REUF_renameMask = "myFile_##name##.##ext##"
RenameUploadedFiles pau_thePath, pau_nameConflict, REUF_renameMask
end if
%>
<%
' Smart Image Processor 2.0.2
Dim sip1
Set sip1 = New ImageProcessor
sip1.ScriptFolder = "ScriptLibrary"
sip1.Component = "AspJpeg"
sip1.Source = "upload"
sip1.UploadFields = ""
sip1.GetFiles
While sip1.HasFiles
sip1.LoadFromSource
sip1.Resize 352, 267, true
sip1.Sharpen
sip1.Overwrite = true
sip1.SaveJPEG 80
sip1.MoveNext
Wend
Set sip1 = Nothing
%>



Charlie

Replies

Replied 15 Dec 2006 23:29:11
15 Dec 2006 23:29:11 jay west replied:
I am having the same error with the same configuration. Has there been any response from the developers?
Replied 16 Dec 2006 00:03:55
16 Dec 2006 00:03:55 Charles Harford replied:
No reply from the developers yet - don't hold your breath as it often takes weeks or months before they respond - if ever. [I'm sure they are very busy people]

I got it working by changing the SIP script to:

<%
If (CStr(Request.QueryString("GP_upload") <> "" Then
' *** Smart Image Processor 2.0.2
Dim sip1
Set sip1 = New ImageProcessor
sip1.ScriptFolder = "ScriptLibrary"
sip1.Component = "AspJpeg"
sip1.Source = "file"
sip1.Load REUF_renameMask
sip1.Resize 352, 267, true
sip1.Sharpen
sip1.Overwrite = true
sip1.SaveJPEG 80
Set sip1 = Nothing
Response.Redirect("mypage.asp"
End If
%>

NOTE the line:
sip1.Load REUF_renameMask
has a variable [REUF_renameMask] that I set earlier on the page to rename the file after upload.

Also note the addition of:

If (CStr(Request.QueryString("GP_upload") <> "" Then

blah blah code block

End IF


I hope this helps.


Charlie

Reply to this topic