Hi All,

why am I getting this error..? Cheers.

Mark Sargent.


Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: '[string: ""]'
/Classifieds/ClassifiedImageResize.asp, line 27

<%
' Create instance of AspJpeg
Set Jpeg = Server.CreateObject("Persits.Jpeg")

' Compute path to source image
Path = Server.MapPath(FilePath)

' Open source image
Jpeg.Open Path

' Create an instance of AspUpload object
Set Upload = Server.CreateObject("Persits.Upload")

' Decrease image size by %
((***Line 27***)) Jpeg.Width = Jpeg.OriginalWidth * Upload.Form("scale") /
100
Jpeg.Height = Jpeg.OriginalHeight * Upload.Form("scale") / 100

' Apply sharpening if necessary
' Jpeg.Sharpen 1, 130

' create thumbnail and save it to disk
FilePath = Replace(FilePath, "/", "\")
FilePath = Replace(FilePath, "ImageUploads\", "")
Jpeg.Save Server.MapPath("ImageUploads\Thumbs") & "\Thumb" & FilePath


%>

Re: Type mismatch: '[string: ""]' by Ray

Ray
Sun Nov 02 11:32:55 CST 2003

What is line 27 and what does a response.write of the variables in question
yield?

Ray at home

"Mark Sargent" <downdogWoof@hotmail.com> wrote in message
news:OXPBJvVoDHA.1728@TK2MSFTNGP09.phx.gbl...
> Hi All,
>
> why am I getting this error..? Cheers.
>
> Mark Sargent.
>
>
> Error Type:
> Microsoft VBScript runtime (0x800A000D)
> Type mismatch: '[string: ""]'
> /Classifieds/ClassifiedImageResize.asp, line 27
>
> <%
> ' Create instance of AspJpeg
> Set Jpeg = Server.CreateObject("Persits.Jpeg")
>
> ' Compute path to source image
> Path = Server.MapPath(FilePath)
>
> ' Open source image
> Jpeg.Open Path
>
> ' Create an instance of AspUpload object
> Set Upload = Server.CreateObject("Persits.Upload")
>
> ' Decrease image size by %
> ((***Line 27***)) Jpeg.Width = Jpeg.OriginalWidth * Upload.Form("scale") /
> 100
> Jpeg.Height = Jpeg.OriginalHeight * Upload.Form("scale") / 100
>
> ' Apply sharpening if necessary
> ' Jpeg.Sharpen 1, 130
>
> ' create thumbnail and save it to disk
> FilePath = Replace(FilePath, "/", "\")
> FilePath = Replace(FilePath, "ImageUploads\", "")
> Jpeg.Save Server.MapPath("ImageUploads\Thumbs") & "\Thumb" & FilePath
>
>
> %>
>
>



Re: Type mismatch: '[string: ""]' by Chris

Chris
Sun Nov 02 11:37:59 CST 2003

Upload.Form("scale") is probably not a number and as such the implicit
coercion to a number is failing.

Try debugging and finding out what this value is returning.

Chris.

"Mark Sargent" <downdogWoof@hotmail.com> wrote in message
news:OXPBJvVoDHA.1728@TK2MSFTNGP09.phx.gbl...
Hi All,

why am I getting this error..? Cheers.

Mark Sargent.


Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: '[string: ""]'
/Classifieds/ClassifiedImageResize.asp, line 27

<%
' Create instance of AspJpeg
Set Jpeg = Server.CreateObject("Persits.Jpeg")

' Compute path to source image
Path = Server.MapPath(FilePath)

' Open source image
Jpeg.Open Path

' Create an instance of AspUpload object
Set Upload = Server.CreateObject("Persits.Upload")

' Decrease image size by %
((***Line 27***)) Jpeg.Width = Jpeg.OriginalWidth * Upload.Form("scale") /
100
Jpeg.Height = Jpeg.OriginalHeight * Upload.Form("scale") / 100

' Apply sharpening if necessary
' Jpeg.Sharpen 1, 130

' create thumbnail and save it to disk
FilePath = Replace(FilePath, "/", "\")
FilePath = Replace(FilePath, "ImageUploads\", "")
Jpeg.Save Server.MapPath("ImageUploads\Thumbs") & "\Thumb" & FilePath


%>




Re: Type mismatch: '[string: ""]' by Rob

Rob
Sun Nov 02 11:51:22 CST 2003

"Mark Sargent" wrote...

> ((***Line 27***)) Jpeg.Width = Jpeg.OriginalWidth * Upload.Form("scale") /
> 100
> Jpeg.Height = Jpeg.OriginalHeight * Upload.Form("scale") / 100


Try :

27: Jpeg.Width = Jpeg.OriginalWidth * (CInt(Upload.Form("scale")) / 100)

and

28: Jpeg.Height = Jpeg.OriginalHeight * (CInt(Upload.Form("scale")) / 100)

(I assume the next line was 28 etc...)

Regards

Rob





Re: Type mismatch: '[string: ""]' by Mark

Mark
Mon Nov 03 07:43:46 CST 2003

Hi All,

thanx..here is what is being passed to the problem page. Cheers.

Mark Sargent.

<HTML>
<HEAD>
<TITLE>AspJpeg - Form.asp</TITLE>
</HEAD>
<BODY>
<%
Dim FilePath
if Request.QueryString("FilePath") <> "" then
FilePath = Request.QueryString("FilePath")
End If
Response.Write FilePath
%>
<!-- Image upload form. Notice the ENCTYPE attribute -->
<FORM ENCTYPE="multipart/form-data" METHOD="POST"
ACTION="ClassifiedImageResize.asp?FilePath=<%=FilePath%>">
<TABLE CELLPADDING="3" CELLSPACING="0" BORDER="0" BGCOLOR="#00FF00"
align="center">
<TR>
<TD>Thumbnail Size:</TD>
<TD>
<SELECT NAME="scale">
<OPTION VALUE="75">75%
<OPTION VALUE="50">50%
<OPTION VALUE="25">25%
<OPTION VALUE="10">10%
</SELECT>
</TD>
</TR>
<TR>
<TD>Description:</TD>
<TD>
<TEXTAREA NAME="Description"></TEXTAREA>
</TD>
</TR>
<TR>
<TD COLSPAN="2">
<INPUT TYPE="SUBMIT" VALUE="Upload">
</TD>
</TR>
</TABLE>
</FORM>

</BODY>
</HTML>



Re: Type mismatch: '[string: ""]' by Mark

Mark
Mon Nov 03 23:12:17 CST 2003

Here is the error I get after adding what you suggested, Rob...Cheers..

Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'CInt'
/Classifieds/ClassifiedImageResize.asp, line 27



Re: Type mismatch: '[string: ""]' by Ray

Ray
Tue Nov 04 00:11:04 CST 2003

And what's on line 27 again?

Ray at home

"Mark Sargent" <downdogWoof@hotmail.com> wrote in message
news:OfvLNFpoDHA.2416@TK2MSFTNGP10.phx.gbl...
> Here is the error I get after adding what you suggested, Rob...Cheers..
>
> Error Type:
> Microsoft VBScript runtime (0x800A000D)
> Type mismatch: 'CInt'
> /Classifieds/ClassifiedImageResize.asp, line 27
>
>



Re: Type mismatch: '[string: ""]' by Chris

Chris
Tue Nov 04 04:00:25 CST 2003

LINE 27:
Jpeg.Width = Jpeg.OriginalWidth * Upload.Form("scale") / 100

Mark, you *can't* fix this using syntax until you determine that the
following are both numeric:

Jpeg.OriginalWidth
Upload.Form("scale")

My money's on the second one not being numeric.

Do you know how to debug or do you need some pointers on what to do?

Chris.


"Mark Sargent" <downdogWoof@hotmail.com> wrote in message
news:OfvLNFpoDHA.2416@TK2MSFTNGP10.phx.gbl...
Here is the error I get after adding what you suggested, Rob...Cheers..

Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'CInt'
/Classifieds/ClassifiedImageResize.asp, line 27




Re: Type mismatch: '[string: ""]' by Ray

Ray
Tue Nov 04 07:40:50 CST 2003

My money's on Chris.

<%
Response.write Jpeg.OriginalWidth & "<br>"
Response.Write Upload.Form("scale")
Response.End
%>

Ray at work

"Chris Barber" <chris@blue-canoe.co.uk.NOSPAM> wrote in message
news:OWeI5proDHA.2064@TK2MSFTNGP11.phx.gbl...
> LINE 27:
> Jpeg.Width = Jpeg.OriginalWidth * Upload.Form("scale") / 100
>
> Mark, you *can't* fix this using syntax until you determine that the
> following are both numeric:
>
> Jpeg.OriginalWidth
> Upload.Form("scale")
>
> My money's on the second one not being numeric.
>
> Do you know how to debug or do you need some pointers on what to do?
>
> Chris.
>
>
> "Mark Sargent" <downdogWoof@hotmail.com> wrote in message
> news:OfvLNFpoDHA.2416@TK2MSFTNGP10.phx.gbl...
> Here is the error I get after adding what you suggested, Rob...Cheers..
>
> Error Type:
> Microsoft VBScript runtime (0x800A000D)
> Type mismatch: 'CInt'
> /Classifieds/ClassifiedImageResize.asp, line 27
>
>
>



Re: Type mismatch: '[string: ""]' by Mark

Mark
Tue Nov 04 11:04:25 CST 2003

Hi All,

I see..Okay, after debugging, it appears that either nothing is passing to
the page or, I'm not calling Upload.Form("scale")
correctly as it doesn't write. I posted before the code from the page
passing the variables; have I got it wrong..? Cheers..

Mark Sargent.



Re: Type mismatch: '[string: ""]' by Mark

Mark
Wed Nov 05 00:09:43 CST 2003

Hi All,

K, I'm an "Idiot"..all together now, "Yes, you're an Idiot"..I was using the
below code on the page where a user could select the resize options. Thing
is, this code is for use when passing form values at the same time as
uploading a file. Thing is, the file upload was done on the previous
page..DOH..No need to call Upload.Form("scale") only need to call
Request.Form("scale")....if you understood all that, you're a
genuis...cheers all.

Mark Sargent.

ENCTYPE="multipart/form-data"