Scripting Error?

J

John

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\pictures\" &
File.FileName & ""
objPictureSize.GetFile(picPath)
pictureNewSize = objPictureSize.Size (this is line 107)

thanks!!
 
B

Ben Strackany

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\pictures\" &
File.FileName & ""
Set objPictureFile = objFSO.GetFile(picPath)
pictureNewSize = objPictureFile.Size
 
J

John

That did it!! Thanks!


Ben Strackany said:
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\pictures\" &
File.FileName & ""
Set objPictureFile = objFSO.GetFile(picPath)
pictureNewSize = objPictureFile.Size
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top