473,378 Members | 1,469 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Type mismatch: '[string: ""]'

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
%>
Jul 19 '05 #1
10 25812
What is line 27 and what does a response.write of the variables in question
yield?

Ray at home

"Mark Sargent" <do*********@hotmail.com> wrote in message
news:OX**************@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
%>

Jul 19 '05 #2
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" <do*********@hotmail.com> wrote in message
news:OX**************@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
%>

Jul 19 '05 #3
"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


Jul 19 '05 #4
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=<%=File Path%>">
<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>
Jul 19 '05 #5
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
Jul 19 '05 #6
And what's on line 27 again?

Ray at home

"Mark Sargent" <do*********@hotmail.com> wrote in message
news:Of**************@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

Jul 19 '05 #7
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" <do*********@hotmail.com> wrote in message
news:Of**************@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

Jul 19 '05 #8
My money's on Chris.

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

Ray at work

"Chris Barber" <ch***@blue-canoe.co.uk.NOSPAM> wrote in message
news:OW**************@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" <do*********@hotmail.com> wrote in message
news:Of**************@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

Jul 19 '05 #9
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.
Jul 19 '05 #10
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"
Jul 19 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: dmgauntt2002 | last post by:
I have some javascript ASP code that sets the expiry date on a cookie to five years from now. The code worked until today, when I got the following error message: Microsoft JScript runtime...
2
by: Andrew Proctor | last post by:
Hello This is not a big problem, but I was hoping someone a bit more knowlegable than I could explain something to me. I have a simple function behind a form which writes changed values to a...
2
by: exsuscito | last post by:
After about 30 minutes of frustration I finally discovered what was causing a general 500 internal server error and to my surprise it was something I seem to always take for granted for its...
1
by: melda | last post by:
I am a real beginnner in ASP. Due to increasing demands on dynamic website, I've been working on ASP website now. I use a ready to use CMS program and right now I've been trying to combine a calendar...
3
by: Snow | last post by:
Hello: I have Error Type: Microsoft VBScript runtime (0x800A000D) Type mismatch: '' The error happened at this line: if session("systemIdCount" & arrSystems(iLoop)) 0 The code like this:
5
by: Davros9 | last post by:
Trying to get Regular Expressions working....... ---------------- Public Function SepString(InField As String) As String ''seperates on space and comma Dim RE As New RegExp Dim Matches As...
17
imrosie
by: imrosie | last post by:
I've tried this string to Sum up payments, moving brackets and paren's different ways, I still get error 'type mismatch'....not sure why. Can anyone point me in the right direction?? thanks ...
10
by: dstorms | last post by:
Hi, I'm trying to create a button on a form that: 1. Takes the ComputerID from the form linked to Table 1, 2. Checks Table 2 for a matching ComputerID, and 3. Opens the query qryEditData, and...
7
vikas251074
by: vikas251074 | last post by:
I am getting error above in following code since few days giving tension day and night. How can I solve this? I am facing since Oct.25. in line no. 362 After doing a lot of homework, I am...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.