473,714 Members | 2,445 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cannot use Request.Form

Hi!

I get an error when I run my code
Is there any other way to get te information from my form?

Heres the error I get and the code beneath.
Line 120 is market with ''''''''''''Lin e 120'''''''''''' '''''''''
''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
''''''''''''''' ''''CODE''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''

Request object error 'ASP 0207 : 80004005'
Cannot use Request.Form

/asp/admin/select_image.as p, line 120

Cannot use Request.Form collection after calling BinaryRead.

''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
''''''''''''''' ''''CODE''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''

if Request.QuerySt ring("action") = "upload" then
Server.ScriptTi meout = 1200
Response.Expire s = 0
Response.Buffer = TRUE
Response.Clear

Dim UploadRequest
Set UploadRequest = CreateObject("S cripting.Dictio nary")

ByteCount = Request.TotalBy tes

if ByteCount > Application("Ma xFileSize2Uploa d") then
Response.Redire ct "./select_image.as p?error=05"
end if
RequestBin = Request.BinaryR ead(byteCount)
BuildUploadRequ est RequestBin

Dim aux, aux1
Dim ImageCateg, ContentType, FilePathName, FileName, Value

ImageCateg = Unescape(Upload Request.Item("i npcatid").Item( "Value")) 'Image
Folder

on error resume next
ContentType = UploadRequest.I tem("inpFile"). Item("ContentTy pe")
FILEFLAG = err.number
on error goto 0

if FILEFLAG = 0 then
ContentType = UploadRequest.I tem("inpFile"). Item("ContentTy pe")
FilePathName = UploadRequest.I tem("inpFile"). Item("FileName" )
FileName =
Right(filepathn ame,Len(filepat hname)-InstrRev(filepa thname,"\"))
Value = UploadRequest.I tem("inpFile"). Item("Value")
else
FileName = ""
end if

Dim objFSO2
Dim objFSO3
Dim objUploadFile
Dim objDelFile1
Dim OldPath
''''''''''''''' laster opp bilde'''''''''' ''''''''''''''' ''''
if FileName<>"" then
on error resume next
Set objFSO2 = Server.CreateOb ject("Scripting .FileSystemObje ct")
Set objUploadFile = objFSO2.CreateT extFile(ImageCa teg&"\"&FileNam e)
objUploadFile.W rite getString(value )
objUploadFile.C lose
FILEFLAG = err.number
on error goto 0
''''''''''''''' resizer bilde'''''''''' ''''''''''''''' ''''
' create instance of AspJpeg object
Set jpeg = Server.CreateOb ject("Persits.J peg")

' open uploaded file
Dim ResizeName
Dim Ratio
OldPath = Server.MapPath( Escape(sDir) & Escape(FileName ))
jpeg.Open( OldPath )
' resize image accoring to "scale" option.

''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
'''''''''Line
120'''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
''''''''''''''' ''''''''''''''' '''
Select Case Request.Form("r esize")

''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
'''''''''/Line
120/''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''
''''''''''''''' ''''''''''''''' ''''
Case "tn"
ResizeName = "_miniatyr"
Ratio = jpeg.OriginalHe ight / 100
jpeg.Width = 100
jpeg.Height = jpeg.OriginalHe ight / Ratio
Case Else
ResizeName = "_noko_anna "
jpeg.Width = jpeg.OriginalWi dth * 50 / 100
jpeg.Height = jpeg.OriginalHe ight * 50 / 100
End Select
OldPath = Server.MapPath( Escape(sDir)) & "\" & Escape(FileName )
SavePath = Left(OldPath, InStrRev(OldPat h, ".") - 1)
SavePath = SavePath & ResizeName
SavePath = SavePath & ".jpg"
Jpeg.Interpolat ion = 2
'AspJpeg always generates JPEG thumbnails regardless of original format.
'If the original file was not a JPEG, append .JPG extension.

jpeg.Save SavePath
end if

Set objFSO2 = nothing
Set objUploadFile = nothing
Set UploadRequest = nothing

Jul 19 '05 #1
6 10332
BinaryRead and Request.Form/QueryString are mutually exclusive. Once you
have used one to read the data, the other is inaccessible.

I found an article on the MSDN library about how to recreate a
pseudo-Request.Form collection but its taken from Active Server Developer's
Journal, so I'm not sure if its on the web. I'll see if I can find a web
article on this, otherwise I'll have a read through the article and give you
the basics here.

A Ratcliffe
ar********@arch imagic.net

"Christophe r Brandsdal" <ch***********@ c2i.net> wrote in message
news:OG******** ******@tk2msftn gp13.phx.gbl...
Hi!

I get an error when I run my code
Is there any other way to get te information from my form?

Heres the error I get and the code beneath.
Line 120 is market with ''''''''''''Lin e 120'''''''''''' '''''''''
''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ' ''''''''''''''' ''''CODE''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''

Request object error 'ASP 0207 : 80004005'
Cannot use Request.Form

/asp/admin/select_image.as p, line 120

Cannot use Request.Form collection after calling BinaryRead.

''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ' ''''''''''''''' ''''CODE''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''

if Request.QuerySt ring("action") = "upload" then
Server.ScriptTi meout = 1200
Response.Expire s = 0
Response.Buffer = TRUE
Response.Clear

Dim UploadRequest
Set UploadRequest = CreateObject("S cripting.Dictio nary")

ByteCount = Request.TotalBy tes

if ByteCount > Application("Ma xFileSize2Uploa d") then
Response.Redire ct "./select_image.as p?error=05"
end if
RequestBin = Request.BinaryR ead(byteCount)
BuildUploadRequ est RequestBin

Dim aux, aux1
Dim ImageCateg, ContentType, FilePathName, FileName, Value

ImageCateg = Unescape(Upload Request.Item("i npcatid").Item( "Value")) 'Image Folder

on error resume next
ContentType = UploadRequest.I tem("inpFile"). Item("ContentTy pe")
FILEFLAG = err.number
on error goto 0

if FILEFLAG = 0 then
ContentType = UploadRequest.I tem("inpFile"). Item("ContentTy pe")
FilePathName = UploadRequest.I tem("inpFile"). Item("FileName" )
FileName =
Right(filepathn ame,Len(filepat hname)-InstrRev(filepa thname,"\"))
Value = UploadRequest.I tem("inpFile"). Item("Value")
else
FileName = ""
end if

Dim objFSO2
Dim objFSO3
Dim objUploadFile
Dim objDelFile1
Dim OldPath
''''''''''''''' laster opp bilde'''''''''' ''''''''''''''' ''''
if FileName<>"" then
on error resume next
Set objFSO2 = Server.CreateOb ject("Scripting .FileSystemObje ct")
Set objUploadFile = objFSO2.CreateT extFile(ImageCa teg&"\"&FileNam e)
objUploadFile.W rite getString(value )
objUploadFile.C lose
FILEFLAG = err.number
on error goto 0
''''''''''''''' resizer bilde'''''''''' ''''''''''''''' ''''
' create instance of AspJpeg object
Set jpeg = Server.CreateOb ject("Persits.J peg")

' open uploaded file
Dim ResizeName
Dim Ratio
OldPath = Server.MapPath( Escape(sDir) & Escape(FileName ))
jpeg.Open( OldPath )
' resize image accoring to "scale" option.

''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ' '''''''''Line
120'''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ' ''''''''''''''' ''''''''''''''' '''
Select Case Request.Form("r esize")

''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ' '''''''''/Line
120/''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '''''''''''' ''''''''''''''' ''''''''''''''' ''''
Case "tn"
ResizeName = "_miniatyr"
Ratio = jpeg.OriginalHe ight / 100
jpeg.Width = 100
jpeg.Height = jpeg.OriginalHe ight / Ratio
Case Else
ResizeName = "_noko_anna "
jpeg.Width = jpeg.OriginalWi dth * 50 / 100
jpeg.Height = jpeg.OriginalHe ight * 50 / 100
End Select
OldPath = Server.MapPath( Escape(sDir)) & "\" & Escape(FileName )
SavePath = Left(OldPath, InStrRev(OldPat h, ".") - 1)
SavePath = SavePath & ResizeName
SavePath = SavePath & ".jpg"
Jpeg.Interpolat ion = 2
'AspJpeg always generates JPEG thumbnails regardless of original format. 'If the original file was not a JPEG, append .JPG extension.

jpeg.Save SavePath
end if

Set objFSO2 = nothing
Set objUploadFile = nothing
Set UploadRequest = nothing

Jul 19 '05 #2
Thanks for helping me!

I think it's possible because AspUpload can do it.

I have AspJpeg installed on my server but NOT AspUpload.
Here is a short AspJpeg script that use something else than Request.Form:

<HTML>
<HEAD>
<TITLE>AspJpe g 1.2 - Upload.asp</TITLE>
</HEAD>
<BODY>

<!-- this script is invoked by form.asp-->
<%
' Create an instance of AspUpload object
Set Upload = Server.CreateOb ject("Persits.U pload")

' Capture uploaded file. Save returns the number of files uploaded
Count = Upload.Save(Ser ver.MapPath("/"))

If Count = 0 Then
Response.Write "No images selected. <A HREF=""form.asp "">Try again</A>."
Response.End
Else

' Obtain File object representing uploaded file
Set File = Upload.Files(1)

' Is this a valid image file?
If File.ImageType <> "UNKNOWN" Then

' create instance of AspJpeg object
Set jpeg = Server.CreateOb ject("Persits.J peg")

' open uploaded file
jpeg.Open( File.Path )

' resize image accoring to "scale" option.
' notice that we cannot use Request.Form, so we use Upload.Form instead.
jpeg.Width = jpeg.OriginalWi dth * Upload.Form("sc ale") / 100
jpeg.Height = jpeg.OriginalHe ight * Upload.Form("sc ale") / 100

SavePath = Server.MapPath( "/bilde/") & File.ExtractFil eName

' AspJpeg always generates JPEG thumbnails regardless of original format.
' If the original file was not a JPEG, append .JPG extension.
If UCase(Right(Sav ePath, 3)) <> "JPG" Then
SavePath = SavePath & ".jpg"
End If

jpeg.Save SavePath

Response.Write "Success! Both the original file and its thumbnail are
saved in the database.<P>"
Response.Write "Copies can be found at <B>c:\upload\ " &
File.ExtractFil eName & "</B> and <B>" & SavePath & "</B>"

Else
Response.Write "This is not a valid image. <A HREF=""form.asp "">Try
again</A>."
Response.End
End If
End If
%>
</BODY>
</HTML>

"A Ratcliffe" <ar********@arc himagic.net> skrev i melding
news:eJ******** ******@TK2MSFTN GP09.phx.gbl...
BinaryRead and Request.Form/QueryString are mutually exclusive. Once you
have used one to read the data, the other is inaccessible.

I found an article on the MSDN library about how to recreate a
pseudo-Request.Form collection but its taken from Active Server Developer's Journal, so I'm not sure if its on the web. I'll see if I can find a web
article on this, otherwise I'll have a read through the article and give you the basics here.

A Ratcliffe
ar********@arch imagic.net

"Christophe r Brandsdal" <ch***********@ c2i.net> wrote in message
news:OG******** ******@tk2msftn gp13.phx.gbl...
Hi!

I get an error when I run my code
Is there any other way to get te information from my form?

Heres the error I get and the code beneath.
Line 120 is market with ''''''''''''Lin e 120'''''''''''' '''''''''

''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '

''''''''''''''' ''''CODE''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''

Request object error 'ASP 0207 : 80004005'
Cannot use Request.Form

/asp/admin/select_image.as p, line 120

Cannot use Request.Form collection after calling BinaryRead.

''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '

''''''''''''''' ''''CODE''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''

if Request.QuerySt ring("action") = "upload" then
Server.ScriptTi meout = 1200
Response.Expire s = 0
Response.Buffer = TRUE
Response.Clear

Dim UploadRequest
Set UploadRequest = CreateObject("S cripting.Dictio nary")

ByteCount = Request.TotalBy tes

if ByteCount > Application("Ma xFileSize2Uploa d") then
Response.Redire ct "./select_image.as p?error=05"
end if
RequestBin = Request.BinaryR ead(byteCount)
BuildUploadRequ est RequestBin

Dim aux, aux1
Dim ImageCateg, ContentType, FilePathName, FileName, Value

ImageCateg = Unescape(Upload Request.Item("i npcatid").Item( "Value"))

'Image
Folder

on error resume next
ContentType = UploadRequest.I tem("inpFile"). Item("ContentTy pe")
FILEFLAG = err.number
on error goto 0

if FILEFLAG = 0 then
ContentType = UploadRequest.I tem("inpFile"). Item("ContentTy pe")
FilePathName = UploadRequest.I tem("inpFile"). Item("FileName" )
FileName =
Right(filepathn ame,Len(filepat hname)-InstrRev(filepa thname,"\"))
Value = UploadRequest.I tem("inpFile"). Item("Value")
else
FileName = ""
end if

Dim objFSO2
Dim objFSO3
Dim objUploadFile
Dim objDelFile1
Dim OldPath
''''''''''''''' laster opp bilde'''''''''' ''''''''''''''' ''''
if FileName<>"" then
on error resume next
Set objFSO2 = Server.CreateOb ject("Scripting .FileSystemObje ct")
Set objUploadFile = objFSO2.CreateT extFile(ImageCa teg&"\"&FileNam e)
objUploadFile.W rite getString(value )
objUploadFile.C lose
FILEFLAG = err.number
on error goto 0
''''''''''''''' resizer bilde'''''''''' ''''''''''''''' ''''
' create instance of AspJpeg object
Set jpeg = Server.CreateOb ject("Persits.J peg")

' open uploaded file
Dim ResizeName
Dim Ratio
OldPath = Server.MapPath( Escape(sDir) & Escape(FileName ))
jpeg.Open( OldPath )
' resize image accoring to "scale" option.

''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
'''''''''Line

120'''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
''''''''''''''' ''''''''''''''' '''
Select Case Request.Form("r esize")

''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
'''''''''/Line

120/''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''
''''''''''''''' ''''''''''''''' ''''
Case "tn"
ResizeName = "_miniatyr"
Ratio = jpeg.OriginalHe ight / 100
jpeg.Width = 100
jpeg.Height = jpeg.OriginalHe ight / Ratio
Case Else
ResizeName = "_noko_anna "
jpeg.Width = jpeg.OriginalWi dth * 50 / 100
jpeg.Height = jpeg.OriginalHe ight * 50 / 100
End Select
OldPath = Server.MapPath( Escape(sDir)) & "\" & Escape(FileName )
SavePath = Left(OldPath, InStrRev(OldPat h, ".") - 1)
SavePath = SavePath & ResizeName
SavePath = SavePath & ".jpg"
Jpeg.Interpolat ion = 2
'AspJpeg always generates JPEG thumbnails regardless of original

format.
'If the original file was not a JPEG, append .JPG extension.

jpeg.Save SavePath
end if

Set objFSO2 = nothing
Set objUploadFile = nothing
Set UploadRequest = nothing


Jul 19 '05 #3
It's definitely possible (the article I mentioned shows how to do so, which
is probably how ASPUpload does it).

"Christophe r Brandsdal" <ch***********@ c2i.net> wrote in message
news:u3******** *****@TK2MSFTNG P10.phx.gbl...
Thanks for helping me!

I think it's possible because AspUpload can do it.

I have AspJpeg installed on my server but NOT AspUpload.
Here is a short AspJpeg script that use something else than Request.Form:

<HTML>
<HEAD>
<TITLE>AspJpe g 1.2 - Upload.asp</TITLE>
</HEAD>
<BODY>

<!-- this script is invoked by form.asp-->
<%
' Create an instance of AspUpload object
Set Upload = Server.CreateOb ject("Persits.U pload")

' Capture uploaded file. Save returns the number of files uploaded
Count = Upload.Save(Ser ver.MapPath("/"))

If Count = 0 Then
Response.Write "No images selected. <A HREF=""form.asp "">Try again</A>."
Response.End
Else

' Obtain File object representing uploaded file
Set File = Upload.Files(1)

' Is this a valid image file?
If File.ImageType <> "UNKNOWN" Then

' create instance of AspJpeg object
Set jpeg = Server.CreateOb ject("Persits.J peg")

' open uploaded file
jpeg.Open( File.Path )

' resize image accoring to "scale" option.
' notice that we cannot use Request.Form, so we use Upload.Form instead. jpeg.Width = jpeg.OriginalWi dth * Upload.Form("sc ale") / 100
jpeg.Height = jpeg.OriginalHe ight * Upload.Form("sc ale") / 100

SavePath = Server.MapPath( "/bilde/") & File.ExtractFil eName

' AspJpeg always generates JPEG thumbnails regardless of original format. ' If the original file was not a JPEG, append .JPG extension.
If UCase(Right(Sav ePath, 3)) <> "JPG" Then
SavePath = SavePath & ".jpg"
End If

jpeg.Save SavePath

Response.Write "Success! Both the original file and its thumbnail are
saved in the database.<P>"
Response.Write "Copies can be found at <B>c:\upload\ " &
File.ExtractFil eName & "</B> and <B>" & SavePath & "</B>"

Else
Response.Write "This is not a valid image. <A HREF=""form.asp "">Try
again</A>."
Response.End
End If
End If
%>
</BODY>
</HTML>

"A Ratcliffe" <ar********@arc himagic.net> skrev i melding
news:eJ******** ******@TK2MSFTN GP09.phx.gbl...
BinaryRead and Request.Form/QueryString are mutually exclusive. Once you
have used one to read the data, the other is inaccessible.

I found an article on the MSDN library about how to recreate a
pseudo-Request.Form collection but its taken from Active Server

Developer's
Journal, so I'm not sure if its on the web. I'll see if I can find a web
article on this, otherwise I'll have a read through the article and give

you
the basics here.

A Ratcliffe
ar********@arch imagic.net

"Christophe r Brandsdal" <ch***********@ c2i.net> wrote in message
news:OG******** ******@tk2msftn gp13.phx.gbl...
Hi!

I get an error when I run my code
Is there any other way to get te information from my form?

Heres the error I get and the code beneath.
Line 120 is market with ''''''''''''Lin e 120'''''''''''' '''''''''

''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '

''''''''''''''' ''''CODE''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''

Request object error 'ASP 0207 : 80004005'
Cannot use Request.Form

/asp/admin/select_image.as p, line 120

Cannot use Request.Form collection after calling BinaryRead.

''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '

''''''''''''''' ''''CODE''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''

if Request.QuerySt ring("action") = "upload" then
Server.ScriptTi meout = 1200
Response.Expire s = 0
Response.Buffer = TRUE
Response.Clear

Dim UploadRequest
Set UploadRequest = CreateObject("S cripting.Dictio nary")

ByteCount = Request.TotalBy tes

if ByteCount > Application("Ma xFileSize2Uploa d") then
Response.Redire ct "./select_image.as p?error=05"
end if
RequestBin = Request.BinaryR ead(byteCount)
BuildUploadRequ est RequestBin

Dim aux, aux1
Dim ImageCateg, ContentType, FilePathName, FileName, Value

ImageCateg = Unescape(Upload Request.Item("i npcatid").Item( "Value"))

'Image
Folder

on error resume next
ContentType = UploadRequest.I tem("inpFile"). Item("ContentTy pe")
FILEFLAG = err.number
on error goto 0

if FILEFLAG = 0 then
ContentType = UploadRequest.I tem("inpFile"). Item("ContentTy pe")
FilePathName = UploadRequest.I tem("inpFile"). Item("FileName" )
FileName =
Right(filepathn ame,Len(filepat hname)-InstrRev(filepa thname,"\"))
Value = UploadRequest.I tem("inpFile"). Item("Value")
else
FileName = ""
end if

Dim objFSO2
Dim objFSO3
Dim objUploadFile
Dim objDelFile1
Dim OldPath
''''''''''''''' laster opp bilde'''''''''' ''''''''''''''' ''''
if FileName<>"" then
on error resume next
Set objFSO2 = Server.CreateOb ject("Scripting .FileSystemObje ct")
Set objUploadFile = objFSO2.CreateT extFile(ImageCa teg&"\"&FileNam e) objUploadFile.W rite getString(value )
objUploadFile.C lose
FILEFLAG = err.number
on error goto 0
''''''''''''''' resizer bilde'''''''''' ''''''''''''''' ''''
' create instance of AspJpeg object
Set jpeg = Server.CreateOb ject("Persits.J peg")

' open uploaded file
Dim ResizeName
Dim Ratio
OldPath = Server.MapPath( Escape(sDir) & Escape(FileName ))
jpeg.Open( OldPath )
' resize image accoring to "scale" option.

''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
'''''''''Line

120'''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
''''''''''''''' ''''''''''''''' '''
Select Case Request.Form("r esize")

''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
'''''''''/Line

120/''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''
''''''''''''''' ''''''''''''''' ''''
Case "tn"
ResizeName = "_miniatyr"
Ratio = jpeg.OriginalHe ight / 100
jpeg.Width = 100
jpeg.Height = jpeg.OriginalHe ight / Ratio
Case Else
ResizeName = "_noko_anna "
jpeg.Width = jpeg.OriginalWi dth * 50 / 100
jpeg.Height = jpeg.OriginalHe ight * 50 / 100
End Select
OldPath = Server.MapPath( Escape(sDir)) & "\" & Escape(FileName )
SavePath = Left(OldPath, InStrRev(OldPat h, ".") - 1)
SavePath = SavePath & ResizeName
SavePath = SavePath & ".jpg"
Jpeg.Interpolat ion = 2
'AspJpeg always generates JPEG thumbnails regardless of original

format.
'If the original file was not a JPEG, append .JPG extension.

jpeg.Save SavePath
end if

Set objFSO2 = nothing
Set objUploadFile = nothing
Set UploadRequest = nothing



Jul 19 '05 #4
A quick glance at the web via serach engine found me this article. Its not
perfect in its explanations, but it does cover parsing your own Request.Form
data after a BinaryRead.

http://www.juicystudio.com/tutorial/asp/upload.html

HTH,

A Ratcliffe
ar********@arch imagic.net

"A Ratcliffe" <ar********@arc himagic.net> wrote in message
news:uw******** ******@TK2MSFTN GP09.phx.gbl...
It's definitely possible (the article I mentioned shows how to do so, which is probably how ASPUpload does it).

"Christophe r Brandsdal" <ch***********@ c2i.net> wrote in message
news:u3******** *****@TK2MSFTNG P10.phx.gbl...
Thanks for helping me!

I think it's possible because AspUpload can do it.

I have AspJpeg installed on my server but NOT AspUpload.
Here is a short AspJpeg script that use something else than Request.Form:

<HTML>
<HEAD>
<TITLE>AspJpe g 1.2 - Upload.asp</TITLE>
</HEAD>
<BODY>

<!-- this script is invoked by form.asp-->
<%
' Create an instance of AspUpload object
Set Upload = Server.CreateOb ject("Persits.U pload")

' Capture uploaded file. Save returns the number of files uploaded
Count = Upload.Save(Ser ver.MapPath("/"))

If Count = 0 Then
Response.Write "No images selected. <A HREF=""form.asp "">Try again</A>." Response.End
Else

' Obtain File object representing uploaded file
Set File = Upload.Files(1)

' Is this a valid image file?
If File.ImageType <> "UNKNOWN" Then

' create instance of AspJpeg object
Set jpeg = Server.CreateOb ject("Persits.J peg")

' open uploaded file
jpeg.Open( File.Path )

' resize image accoring to "scale" option.
' notice that we cannot use Request.Form, so we use Upload.Form

instead.
jpeg.Width = jpeg.OriginalWi dth * Upload.Form("sc ale") / 100
jpeg.Height = jpeg.OriginalHe ight * Upload.Form("sc ale") / 100

SavePath = Server.MapPath( "/bilde/") & File.ExtractFil eName

' AspJpeg always generates JPEG thumbnails regardless of original

format.
' If the original file was not a JPEG, append .JPG extension.
If UCase(Right(Sav ePath, 3)) <> "JPG" Then
SavePath = SavePath & ".jpg"
End If

jpeg.Save SavePath

Response.Write "Success! Both the original file and its thumbnail are
saved in the database.<P>"
Response.Write "Copies can be found at <B>c:\upload\ " &
File.ExtractFil eName & "</B> and <B>" & SavePath & "</B>"

Else
Response.Write "This is not a valid image. <A HREF=""form.asp "">Try
again</A>."
Response.End
End If
End If
%>
</BODY>
</HTML>

"A Ratcliffe" <ar********@arc himagic.net> skrev i melding
news:eJ******** ******@TK2MSFTN GP09.phx.gbl...
BinaryRead and Request.Form/QueryString are mutually exclusive. Once you have used one to read the data, the other is inaccessible.

I found an article on the MSDN library about how to recreate a
pseudo-Request.Form collection but its taken from Active Server

Developer's
Journal, so I'm not sure if its on the web. I'll see if I can find a web article on this, otherwise I'll have a read through the article and give
you
the basics here.

A Ratcliffe
ar********@arch imagic.net

"Christophe r Brandsdal" <ch***********@ c2i.net> wrote in message
news:OG******** ******@tk2msftn gp13.phx.gbl...
> Hi!
>
> I get an error when I run my code
> Is there any other way to get te information from my form?
>
> Heres the error I get and the code beneath.
> Line 120 is market with ''''''''''''Lin e 120'''''''''''' '''''''''
>
>
>

''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ' >

''''''''''''''' ''''CODE''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
> ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''
>
> Request object error 'ASP 0207 : 80004005'
> Cannot use Request.Form
>
> /asp/admin/select_image.as p, line 120
>
> Cannot use Request.Form collection after calling BinaryRead.
>
>

''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
>

''''''''''''''' ''''CODE''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
> ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''
>
> if Request.QuerySt ring("action") = "upload" then
> Server.ScriptTi meout = 1200
> Response.Expire s = 0
> Response.Buffer = TRUE
> Response.Clear
>
> Dim UploadRequest
> Set UploadRequest = CreateObject("S cripting.Dictio nary")
>
> ByteCount = Request.TotalBy tes
>
> if ByteCount > Application("Ma xFileSize2Uploa d") then
> Response.Redire ct "./select_image.as p?error=05"
> end if
>
>
> RequestBin = Request.BinaryR ead(byteCount)
> BuildUploadRequ est RequestBin
>
> Dim aux, aux1
> Dim ImageCateg, ContentType, FilePathName, FileName, Value
>
> ImageCateg = Unescape(Upload Request.Item("i npcatid").Item( "Value")) 'Image
> Folder
>
> on error resume next
> ContentType = UploadRequest.I tem("inpFile"). Item("ContentTy pe")
> FILEFLAG = err.number
> on error goto 0
>
> if FILEFLAG = 0 then
> ContentType = UploadRequest.I tem("inpFile"). Item("ContentTy pe")
> FilePathName = UploadRequest.I tem("inpFile"). Item("FileName" )
> FileName =
> Right(filepathn ame,Len(filepat hname)-InstrRev(filepa thname,"\"))
> Value = UploadRequest.I tem("inpFile"). Item("Value")
> else
> FileName = ""
> end if
>
> Dim objFSO2
> Dim objFSO3
> Dim objUploadFile
> Dim objDelFile1
> Dim OldPath
> ''''''''''''''' laster opp bilde'''''''''' ''''''''''''''' ''''
> if FileName<>"" then
> on error resume next
> Set objFSO2 = Server.CreateOb ject("Scripting .FileSystemObje ct")
> Set objUploadFile = objFSO2.CreateT extFile(ImageCa teg&"\"&FileNam e) > objUploadFile.W rite getString(value )
> objUploadFile.C lose
> FILEFLAG = err.number
> on error goto 0
> ''''''''''''''' resizer bilde'''''''''' ''''''''''''''' ''''
> ' create instance of AspJpeg object
> Set jpeg = Server.CreateOb ject("Persits.J peg")
>
> ' open uploaded file
> Dim ResizeName
> Dim Ratio
> OldPath = Server.MapPath( Escape(sDir) & Escape(FileName ))
> jpeg.Open( OldPath )
> ' resize image accoring to "scale" option.
>
>

''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
> '''''''''Line
>

120'''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
> ''''''''''''''' ''''''''''''''' '''
> Select Case Request.Form("r esize")
>
>

''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
> '''''''''/Line
>

120/''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''
> ''''''''''''''' ''''''''''''''' ''''
> Case "tn"
> ResizeName = "_miniatyr"
> Ratio = jpeg.OriginalHe ight / 100
> jpeg.Width = 100
> jpeg.Height = jpeg.OriginalHe ight / Ratio
> Case Else
> ResizeName = "_noko_anna "
> jpeg.Width = jpeg.OriginalWi dth * 50 / 100
> jpeg.Height = jpeg.OriginalHe ight * 50 / 100
> End Select
> OldPath = Server.MapPath( Escape(sDir)) & "\" & Escape(FileName )
> SavePath = Left(OldPath, InStrRev(OldPat h, ".") - 1)
> SavePath = SavePath & ResizeName
> SavePath = SavePath & ".jpg"
> Jpeg.Interpolat ion = 2
> 'AspJpeg always generates JPEG thumbnails regardless of original
format.
> 'If the original file was not a JPEG, append .JPG extension.
>
> jpeg.Save SavePath
> end if
>
> Set objFSO2 = nothing
> Set objUploadFile = nothing
> Set UploadRequest = nothing
>
>
>



Jul 19 '05 #5
Have you considered a free solution?
It doesn't mention accessing the form variables on the page, but in the
readme.txt file it does.
http://www.asp101.com/articles/jacob/scriptupload.asp
"Christophe r Brandsdal" <ch***********@ c2i.net> wrote in message
news:u3******** *****@TK2MSFTNG P10.phx.gbl...
Thanks for helping me!

I think it's possible because AspUpload can do it.

I have AspJpeg installed on my server but NOT AspUpload.
Here is a short AspJpeg script that use something else than Request.Form:

<HTML>
<HEAD>
<TITLE>AspJpe g 1.2 - Upload.asp</TITLE>
</HEAD>
<BODY>

<!-- this script is invoked by form.asp-->
<%
' Create an instance of AspUpload object
Set Upload = Server.CreateOb ject("Persits.U pload")

' Capture uploaded file. Save returns the number of files uploaded
Count = Upload.Save(Ser ver.MapPath("/"))

If Count = 0 Then
Response.Write "No images selected. <A HREF=""form.asp "">Try again</A>."
Response.End
Else

' Obtain File object representing uploaded file
Set File = Upload.Files(1)

' Is this a valid image file?
If File.ImageType <> "UNKNOWN" Then

' create instance of AspJpeg object
Set jpeg = Server.CreateOb ject("Persits.J peg")

' open uploaded file
jpeg.Open( File.Path )

' resize image accoring to "scale" option.
' notice that we cannot use Request.Form, so we use Upload.Form instead. jpeg.Width = jpeg.OriginalWi dth * Upload.Form("sc ale") / 100
jpeg.Height = jpeg.OriginalHe ight * Upload.Form("sc ale") / 100

SavePath = Server.MapPath( "/bilde/") & File.ExtractFil eName

' AspJpeg always generates JPEG thumbnails regardless of original format. ' If the original file was not a JPEG, append .JPG extension.
If UCase(Right(Sav ePath, 3)) <> "JPG" Then
SavePath = SavePath & ".jpg"
End If

jpeg.Save SavePath

Response.Write "Success! Both the original file and its thumbnail are
saved in the database.<P>"
Response.Write "Copies can be found at <B>c:\upload\ " &
File.ExtractFil eName & "</B> and <B>" & SavePath & "</B>"

Else
Response.Write "This is not a valid image. <A HREF=""form.asp "">Try
again</A>."
Response.End
End If
End If
%>
</BODY>
</HTML>

"A Ratcliffe" <ar********@arc himagic.net> skrev i melding
news:eJ******** ******@TK2MSFTN GP09.phx.gbl...
BinaryRead and Request.Form/QueryString are mutually exclusive. Once you
have used one to read the data, the other is inaccessible.

I found an article on the MSDN library about how to recreate a
pseudo-Request.Form collection but its taken from Active Server

Developer's
Journal, so I'm not sure if its on the web. I'll see if I can find a web
article on this, otherwise I'll have a read through the article and give

you
the basics here.

A Ratcliffe
ar********@arch imagic.net

"Christophe r Brandsdal" <ch***********@ c2i.net> wrote in message
news:OG******** ******@tk2msftn gp13.phx.gbl...
Hi!

I get an error when I run my code
Is there any other way to get te information from my form?

Heres the error I get and the code beneath.
Line 120 is market with ''''''''''''Lin e 120'''''''''''' '''''''''

''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '

''''''''''''''' ''''CODE''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''

Request object error 'ASP 0207 : 80004005'
Cannot use Request.Form

/asp/admin/select_image.as p, line 120

Cannot use Request.Form collection after calling BinaryRead.

''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '

''''''''''''''' ''''CODE''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''

if Request.QuerySt ring("action") = "upload" then
Server.ScriptTi meout = 1200
Response.Expire s = 0
Response.Buffer = TRUE
Response.Clear

Dim UploadRequest
Set UploadRequest = CreateObject("S cripting.Dictio nary")

ByteCount = Request.TotalBy tes

if ByteCount > Application("Ma xFileSize2Uploa d") then
Response.Redire ct "./select_image.as p?error=05"
end if
RequestBin = Request.BinaryR ead(byteCount)
BuildUploadRequ est RequestBin

Dim aux, aux1
Dim ImageCateg, ContentType, FilePathName, FileName, Value

ImageCateg = Unescape(Upload Request.Item("i npcatid").Item( "Value"))

'Image
Folder

on error resume next
ContentType = UploadRequest.I tem("inpFile"). Item("ContentTy pe")
FILEFLAG = err.number
on error goto 0

if FILEFLAG = 0 then
ContentType = UploadRequest.I tem("inpFile"). Item("ContentTy pe")
FilePathName = UploadRequest.I tem("inpFile"). Item("FileName" )
FileName =
Right(filepathn ame,Len(filepat hname)-InstrRev(filepa thname,"\"))
Value = UploadRequest.I tem("inpFile"). Item("Value")
else
FileName = ""
end if

Dim objFSO2
Dim objFSO3
Dim objUploadFile
Dim objDelFile1
Dim OldPath
''''''''''''''' laster opp bilde'''''''''' ''''''''''''''' ''''
if FileName<>"" then
on error resume next
Set objFSO2 = Server.CreateOb ject("Scripting .FileSystemObje ct")
Set objUploadFile = objFSO2.CreateT extFile(ImageCa teg&"\"&FileNam e) objUploadFile.W rite getString(value )
objUploadFile.C lose
FILEFLAG = err.number
on error goto 0
''''''''''''''' resizer bilde'''''''''' ''''''''''''''' ''''
' create instance of AspJpeg object
Set jpeg = Server.CreateOb ject("Persits.J peg")

' open uploaded file
Dim ResizeName
Dim Ratio
OldPath = Server.MapPath( Escape(sDir) & Escape(FileName ))
jpeg.Open( OldPath )
' resize image accoring to "scale" option.

''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
'''''''''Line

120'''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
''''''''''''''' ''''''''''''''' '''
Select Case Request.Form("r esize")

''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
'''''''''/Line

120/''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''
''''''''''''''' ''''''''''''''' ''''
Case "tn"
ResizeName = "_miniatyr"
Ratio = jpeg.OriginalHe ight / 100
jpeg.Width = 100
jpeg.Height = jpeg.OriginalHe ight / Ratio
Case Else
ResizeName = "_noko_anna "
jpeg.Width = jpeg.OriginalWi dth * 50 / 100
jpeg.Height = jpeg.OriginalHe ight * 50 / 100
End Select
OldPath = Server.MapPath( Escape(sDir)) & "\" & Escape(FileName )
SavePath = Left(OldPath, InStrRev(OldPat h, ".") - 1)
SavePath = SavePath & ResizeName
SavePath = SavePath & ".jpg"
Jpeg.Interpolat ion = 2
'AspJpeg always generates JPEG thumbnails regardless of original

format.
'If the original file was not a JPEG, append .JPG extension.

jpeg.Save SavePath
end if

Set objFSO2 = nothing
Set objUploadFile = nothing
Set UploadRequest = nothing



Jul 19 '05 #6
Thank you :)
When I read the article I thought.... AHA!
hehe
The problem is solved, and I am happy as a butterfly ;)

"A Ratcliffe" <ar********@arc himagic.net> skrev i melding
news:ev******** ******@TK2MSFTN GP10.phx.gbl...
A quick glance at the web via serach engine found me this article. Its not
perfect in its explanations, but it does cover parsing your own Request.Form data after a BinaryRead.

http://www.juicystudio.com/tutorial/asp/upload.html

HTH,

A Ratcliffe
ar********@arch imagic.net

"A Ratcliffe" <ar********@arc himagic.net> wrote in message
news:uw******** ******@TK2MSFTN GP09.phx.gbl...
It's definitely possible (the article I mentioned shows how to do so,

which
is probably how ASPUpload does it).

"Christophe r Brandsdal" <ch***********@ c2i.net> wrote in message
news:u3******** *****@TK2MSFTNG P10.phx.gbl...
Thanks for helping me!

I think it's possible because AspUpload can do it.

I have AspJpeg installed on my server but NOT AspUpload.
Here is a short AspJpeg script that use something else than Request.Form:
<HTML>
<HEAD>
<TITLE>AspJpe g 1.2 - Upload.asp</TITLE>
</HEAD>
<BODY>

<!-- this script is invoked by form.asp-->
<%
' Create an instance of AspUpload object
Set Upload = Server.CreateOb ject("Persits.U pload")

' Capture uploaded file. Save returns the number of files uploaded
Count = Upload.Save(Ser ver.MapPath("/"))

If Count = 0 Then
Response.Write "No images selected. <A HREF=""form.asp "">Try again</A>." Response.End
Else

' Obtain File object representing uploaded file
Set File = Upload.Files(1)

' Is this a valid image file?
If File.ImageType <> "UNKNOWN" Then

' create instance of AspJpeg object
Set jpeg = Server.CreateOb ject("Persits.J peg")

' open uploaded file
jpeg.Open( File.Path )

' resize image accoring to "scale" option.
' notice that we cannot use Request.Form, so we use Upload.Form

instead.
jpeg.Width = jpeg.OriginalWi dth * Upload.Form("sc ale") / 100
jpeg.Height = jpeg.OriginalHe ight * Upload.Form("sc ale") / 100

SavePath = Server.MapPath( "/bilde/") & File.ExtractFil eName

' AspJpeg always generates JPEG thumbnails regardless of original

format.
' If the original file was not a JPEG, append .JPG extension.
If UCase(Right(Sav ePath, 3)) <> "JPG" Then
SavePath = SavePath & ".jpg"
End If

jpeg.Save SavePath

Response.Write "Success! Both the original file and its thumbnail are saved in the database.<P>"
Response.Write "Copies can be found at <B>c:\upload\ " &
File.ExtractFil eName & "</B> and <B>" & SavePath & "</B>"

Else
Response.Write "This is not a valid image. <A HREF=""form.asp "">Try
again</A>."
Response.End
End If
End If
%>
</BODY>
</HTML>

"A Ratcliffe" <ar********@arc himagic.net> skrev i melding
news:eJ******** ******@TK2MSFTN GP09.phx.gbl...
> BinaryRead and Request.Form/QueryString are mutually exclusive. Once you > have used one to read the data, the other is inaccessible.
>
> I found an article on the MSDN library about how to recreate a
> pseudo-Request.Form collection but its taken from Active Server
Developer's
> Journal, so I'm not sure if its on the web. I'll see if I can find a web > article on this, otherwise I'll have a read through the article and give you
> the basics here.
>
> A Ratcliffe
> ar********@arch imagic.net
>
> "Christophe r Brandsdal" <ch***********@ c2i.net> wrote in message
> news:OG******** ******@tk2msftn gp13.phx.gbl...
> > Hi!
> >
> > I get an error when I run my code
> > Is there any other way to get te information from my form?
> >
> > Heres the error I get and the code beneath.
> > Line 120 is market with ''''''''''''Lin e 120'''''''''''' '''''''''
> >
> >
> >
>

''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
> >
>

''''''''''''''' ''''CODE''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
> > ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''
> >
> > Request object error 'ASP 0207 : 80004005'
> > Cannot use Request.Form
> >
> > /asp/admin/select_image.as p, line 120
> >
> > Cannot use Request.Form collection after calling BinaryRead.
> >
> >
>

''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
> >
>

''''''''''''''' ''''CODE''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
> > ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''
> >
> > if Request.QuerySt ring("action") = "upload" then
> > Server.ScriptTi meout = 1200
> > Response.Expire s = 0
> > Response.Buffer = TRUE
> > Response.Clear
> >
> > Dim UploadRequest
> > Set UploadRequest = CreateObject("S cripting.Dictio nary")
> >
> > ByteCount = Request.TotalBy tes
> >
> > if ByteCount > Application("Ma xFileSize2Uploa d") then
> > Response.Redire ct "./select_image.as p?error=05"
> > end if
> >
> >
> > RequestBin = Request.BinaryR ead(byteCount)
> > BuildUploadRequ est RequestBin
> >
> > Dim aux, aux1
> > Dim ImageCateg, ContentType, FilePathName, FileName, Value
> >
> > ImageCateg = Unescape(Upload Request.Item("i npcatid").Item( "Value")) > 'Image
> > Folder
> >
> > on error resume next
> > ContentType = UploadRequest.I tem("inpFile"). Item("ContentTy pe")
> > FILEFLAG = err.number
> > on error goto 0
> >
> > if FILEFLAG = 0 then
> > ContentType = UploadRequest.I tem("inpFile"). Item("ContentTy pe") > > FilePathName = UploadRequest.I tem("inpFile"). Item("FileName" )
> > FileName =
> > Right(filepathn ame,Len(filepat hname)-InstrRev(filepa thname,"\"))
> > Value = UploadRequest.I tem("inpFile"). Item("Value")
> > else
> > FileName = ""
> > end if
> >
> > Dim objFSO2
> > Dim objFSO3
> > Dim objUploadFile
> > Dim objDelFile1
> > Dim OldPath
> > ''''''''''''''' laster opp bilde'''''''''' ''''''''''''''' ''''
> > if FileName<>"" then
> > on error resume next
> > Set objFSO2 = Server.CreateOb ject("Scripting .FileSystemObje ct") > > Set objUploadFile =

objFSO2.CreateT extFile(ImageCa teg&"\"&FileNam e)
> > objUploadFile.W rite getString(value )
> > objUploadFile.C lose
> > FILEFLAG = err.number
> > on error goto 0
> > ''''''''''''''' resizer bilde'''''''''' ''''''''''''''' ''''
> > ' create instance of AspJpeg object
> > Set jpeg = Server.CreateOb ject("Persits.J peg")
> >
> > ' open uploaded file
> > Dim ResizeName
> > Dim Ratio
> > OldPath = Server.MapPath( Escape(sDir) & Escape(FileName ))
> > jpeg.Open( OldPath )
> > ' resize image accoring to "scale" option.
> >
> >
>

''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
> > '''''''''Line
> >
>

120'''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
> > ''''''''''''''' ''''''''''''''' '''
> > Select Case Request.Form("r esize")
> >
> >
>

''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '
> > '''''''''/Line
> >
>

120/''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''
> > ''''''''''''''' ''''''''''''''' ''''
> > Case "tn"
> > ResizeName = "_miniatyr"
> > Ratio = jpeg.OriginalHe ight / 100
> > jpeg.Width = 100
> > jpeg.Height = jpeg.OriginalHe ight / Ratio
> > Case Else
> > ResizeName = "_noko_anna "
> > jpeg.Width = jpeg.OriginalWi dth * 50 / 100
> > jpeg.Height = jpeg.OriginalHe ight * 50 / 100
> > End Select
> > OldPath = Server.MapPath( Escape(sDir)) & "\" & Escape(FileName )
> > SavePath = Left(OldPath, InStrRev(OldPat h, ".") - 1)
> > SavePath = SavePath & ResizeName
> > SavePath = SavePath & ".jpg"
> > Jpeg.Interpolat ion = 2
> > 'AspJpeg always generates JPEG thumbnails regardless of original > format.
> > 'If the original file was not a JPEG, append .JPG extension.
> >
> > jpeg.Save SavePath
> > end if
> >
> > Set objFSO2 = nothing
> > Set objUploadFile = nothing
> > Set UploadRequest = nothing
> >
> >
> >
>
>



Jul 19 '05 #7

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

Similar topics

4
10303
by: nc | last post by:
My iterator can find my collection when my Action class calls my jsp directly, however when my Action class calls an html file that is set up with IFrames (one of which is loading that same jsp), I get a servlet error "cannot find collection". Not usre if my issue is HTML, JSP, WebSphere or ??? Any help is very much appreciated. HTML file: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
5
4928
by: rathnesh | last post by:
when using a web application which includes taking an asp page then going to another asp page and coming back to first page ...some times connection to iis gets terminated and page canot be displayed error comes ..this error does'nt comes on a particular page .please help me to solve this problem..
5
1636
by: M P | last post by:
Hi Team! Hope that you could help me! Its been days since I made this script but I cannot fix the problem! IE is prompting me that there is a Syntax Error but it seems that the syntax is OK! Can you help me find the problem? Note the fields PartNo and ItemDesc is the only text data type on my MS Access database.
2
22811
by: CJM | last post by:
I'm running a stored procedure that inserts a record into a table then returns the Identity field value. I've done this kind of thing plenty of times in the past, but I'm obviously doing something wrong this time.. I've tested the Stored Proc in QA and it works fine. The SQL code runs OK in ASP (iAffected = 1 which shows the record is inserted), but when I try to query the resulting recordset, I get an error: "Item cannot be found in...
2
1508
by: Jack | last post by:
Hi, I got a simple form where one needs to input data. The data is being processed in an asp page. However, I cannot figure out why couple of values I am typing in the form is not being retrived in the asp processing page. Instead it shows as a null value. Any help is appreciated. I have attached the major code for the form, the processing page and output on the screen including sql output. Any help is appreciated. Regards.
4
5909
by: Zibi | last post by:
I try to use script from www.freeaspupload.net for upload file. I need to store in session object the names of uploaded files but I get an error - Cannot use Request.Form collection after calling BinaryRead How can I make it? Part of this script: <form name="frmSend" method="POST" enctype="multipart/form-data" action="upload_file.asp" onSubmit="return onSubmitForm();"> <span>File 1 :</span> <input type="file" name="file" size="35"
8
5476
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I debug it in PHP designer, it works with no problems, I get the test email. If
2
8971
by: Griff | last post by:
Bizarre problem here.... I have a classic ASP web page that exists in one project. I have copied this code file into another web project and it errors! The code has not been altered in any way, so I'm not sure why its errored. In more details: The page starts by validating the user, so reads from the request object,
1
2466
by: teenagelcruise | last post by:
hi, i have a problem with my code which is i cannot update and addnew data into the database but i can delete the data.plz give me an idea.this is my code that i wrote. <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Order Record</title> <meta name="Microsoft Border" content="tlb, default"> </head>
0
8810
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8712
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9316
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9078
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6638
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5959
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4729
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2526
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2113
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.