Connecting Tech Pros Worldwide Forums | Help | Site Map

Scripting Error?

John
Guest
 
Posts: n/a
#1: Jul 22 '05
Can't get this to work. I'm creating a workaround for the absence of
aspJPEG on my server. I'm using aspUpload but my server only uses aspThumb.
After aspThumb optimizes the original pic the file size changes and I need
to reflect that change. When using aspUpload I can reference it's built in
File object references but they only refer to the "original" file. There's
an easy solution when using aspJPEG but not with aspThumb so I'm trying to
get the "new" picture size using a scripting object with this script but I'm
getting this error.

Microsoft VBScript runtime error '800a01b6'

Object doesn't support this property or method: 'objPictureSize.Size'

/admin/media_upload_picture_process.asp, line 107


Set objPictureSize = Server.CreateObject("Scripting.FileSystemObject")
picPath = "e:\InetPub\Clients\thehalftonhorns.com\media\pict ures\" &
File.FileName & ""
objPictureSize.GetFile(picPath)
pictureNewSize = objPictureSize.Size (this is line 107)

thanks!!



Ben Strackany
Guest
 
Posts: n/a
#2: Jul 22 '05

re: Scripting Error?


The Size property is part of the File object, not FileSystemObject.
FileSystemObject is more of a utility class -- it doesn't represent
individual directories or files.

Try code like what I pasted below. See how I create a new File object
(objPictureFile) & access that.

Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
picPath = "e:\InetPub\Clients\thehalftonhorns.com\media\pict ures\" &
File.FileName & ""
Set objPictureFile = objFSO.GetFile(picPath)
pictureNewSize = objPictureFile.Size

--
Ben Strackany
www.developmentnow.com


"John" <noway@amIgivingitouthere.com> wrote in message
news:sAoQd.9598$nC5.6809@twister.nyroc.rr.com...[color=blue]
> Can't get this to work. I'm creating a workaround for the absence of
> aspJPEG on my server. I'm using aspUpload but my server only uses[/color]
aspThumb.[color=blue]
> After aspThumb optimizes the original pic the file size changes and I need
> to reflect that change. When using aspUpload I can reference it's built[/color]
in[color=blue]
> File object references but they only refer to the "original" file.[/color]
There's[color=blue]
> an easy solution when using aspJPEG but not with aspThumb so I'm trying to
> get the "new" picture size using a scripting object with this script but[/color]
I'm[color=blue]
> getting this error.
>
> Microsoft VBScript runtime error '800a01b6'
>
> Object doesn't support this property or method: 'objPictureSize.Size'
>
> /admin/media_upload_picture_process.asp, line 107
>
>
> Set objPictureSize = Server.CreateObject("Scripting.FileSystemObject")
> picPath = "e:\InetPub\Clients\thehalftonhorns.com\media\pict ures\" &
> File.FileName & ""
> objPictureSize.GetFile(picPath)
> pictureNewSize = objPictureSize.Size (this is line 107)
>
> thanks!!
>
>
>[/color]


John
Guest
 
Posts: n/a
#3: Jul 22 '05

re: Scripting Error?


That did it!! Thanks!


"Ben Strackany" <infoNOSPAM@developmentnow.nospam.com> wrote in message
news:ulgXwb4EFHA.3384@tk2msftngp13.phx.gbl...[color=blue]
> The Size property is part of the File object, not FileSystemObject.
> FileSystemObject is more of a utility class -- it doesn't represent
> individual directories or files.
>
> Try code like what I pasted below. See how I create a new File object
> (objPictureFile) & access that.
>
> Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
> picPath = "e:\InetPub\Clients\thehalftonhorns.com\media\pict ures\" &
> File.FileName & ""
> Set objPictureFile = objFSO.GetFile(picPath)
> pictureNewSize = objPictureFile.Size
>
> --
> Ben Strackany
> www.developmentnow.com
>
>
> "John" <noway@amIgivingitouthere.com> wrote in message
> news:sAoQd.9598$nC5.6809@twister.nyroc.rr.com...[color=green]
> > Can't get this to work. I'm creating a workaround for the absence of
> > aspJPEG on my server. I'm using aspUpload but my server only uses[/color]
> aspThumb.[color=green]
> > After aspThumb optimizes the original pic the file size changes and I[/color][/color]
need[color=blue][color=green]
> > to reflect that change. When using aspUpload I can reference it's built[/color]
> in[color=green]
> > File object references but they only refer to the "original" file.[/color]
> There's[color=green]
> > an easy solution when using aspJPEG but not with aspThumb so I'm trying[/color][/color]
to[color=blue][color=green]
> > get the "new" picture size using a scripting object with this script but[/color]
> I'm[color=green]
> > getting this error.
> >
> > Microsoft VBScript runtime error '800a01b6'
> >
> > Object doesn't support this property or method: 'objPictureSize.Size'
> >
> > /admin/media_upload_picture_process.asp, line 107
> >
> >
> > Set objPictureSize = Server.CreateObject("Scripting.FileSystemObject")
> > picPath = "e:\InetPub\Clients\thehalftonhorns.com\media\pict ures\" &
> > File.FileName & ""
> > objPictureSize.GetFile(picPath)
> > pictureNewSize = objPictureSize.Size (this is line 107)
> >
> > thanks!!
> >
> >
> >[/color]
>
>[/color]


Closed Thread


Similar ASP / Active Server Pages bytes