Scripting Error?

Discussion in 'ASP General' started by John, Feb 15, 2005.

  1. John

    John Guest

    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!!
    John, Feb 15, 2005
    #1
    1. Advertising

  2. 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

    --
    Ben Strackany
    www.developmentnow.com


    "John" <> wrote in message
    news:sAoQd.9598$...
    > 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!!
    >
    >
    >
    Ben Strackany, Feb 15, 2005
    #2
    1. Advertising

  3. John

    John Guest

    That did it!! Thanks!


    "Ben Strackany" <> wrote in message
    news:...
    > 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
    >
    > --
    > Ben Strackany
    > www.developmentnow.com
    >
    >
    > "John" <> wrote in message
    > news:sAoQd.9598$...
    > > 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!!
    > >
    > >
    > >

    >
    >
    John, Feb 15, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ron Stephens
    Replies:
    23
    Views:
    2,767
    Ron Stephens
    Apr 12, 2004
  2. DaveInSidney
    Replies:
    0
    Views:
    391
    DaveInSidney
    May 9, 2005
  3. Mark Tarver

    strange python scripting error

    Mark Tarver, Jul 23, 2009, in forum: Python
    Replies:
    14
    Views:
    471
    Dave Angel
    Jul 26, 2009
  4. Neil

    Cross Site Scripting & Custom Error Pages

    Neil, Dec 21, 2004, in forum: ASP .Net Security
    Replies:
    0
    Views:
    107
  5. Vaibhav

    Scripting.Divtionary object error

    Vaibhav, Jun 28, 2004, in forum: ASP General
    Replies:
    2
    Views:
    89
    Vaibhav
    Jun 29, 2004
Loading...

Share This Page