Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 279903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:04:19+00:00 2026-05-12T05:04:19+00:00

I help moderate a forum online, and on this forum we restrict the size

  • 0

I help moderate a forum online, and on this forum we restrict the size of signatures. At the moment we test this via a simple Greasemonkey script I wrote; we wrap all signatures with a <div>, the script looks for them, and then measures the div’s height and width.

All the script does right now is make sure the signature resides in a particular height/width. I would like to start measuring the file size of the images inside of a signature automatically so that the script can automatically flag users who are including huge images in their signature. However, I can’t seem to find a way to measure the size of images loaded on the page. I’ve searched and found a property special to IE (element.fileSize) but I obviously can’t use that in my Greasemonkey script.

Is there a way to find out the file size of an image in Firefox via JavaScript?

Edit: People are misinterpreting the problem. The forums themselves do not host images; we host the BBCode that people enter as their signature. So, for example, people enter this:

This is my signature, check out my [url=http://google.com]awesome website[/url]!
This image is cool!  [img]http://image.gif[/img]

I want to be able to check on these images via Greasemonkey. I could write a batch script to scan all of these instead, but I’m just wondering if there’s a way to augment my current script.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T05:04:19+00:00Added an answer on May 12, 2026 at 5:04 am

    Short answer, you cannot

    Also, Check on jGuru How can you check the file size from JavaScript in a form with an input type of file?

    You will find some important points

    Well the answer is very simple, you cannot.

    Reason: The browser security does not allow the scripts
    (Javascript/VBScript) or even applets and ActiveX Controls to read
    files from the local hard disk. You can only read files if your code
    is signed by some Certificate Authority (CA). Now the input type
    “FILE” also does not have the permission to read files. We cannot do
    anything about that since thats what HTML says. So since it cannot
    read files, it cannot find the size of the file with which the input
    tag is associated. Since it cannot find the file size, there is no
    function exposed by JavaScript/VBScript to return the file size. But
    if you need to find the file size, say in order to restrict the size
    of the file uploaded to your web-server. Then you can do so by
    counting the file contents on the server-side, once the user submits
    it to the server. Thats what many of the free e-mail providers like
    http://www.hotmail.com do.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Help me with my code, because i don't now how to do this simple
Help from the SQL Gods Required Table 1 - DistinctQuotes This tables holds information
help out a noob with a simple web development question?? I want to create
help me with this. Take example: I have this normal url localhost/CI/index.php/base/storeurl. How can
I'm a moderate fan of using Exception subtypes to help describe the problem that
Help! When I install my app on the phone to test, it is showing
Help Help! Google indexed a test folder on my website which no one save
Help! I have a clickonce app built and published using .Net 2.0. This app
Help me understand this piece of code - After the first iteration the value
Help with this criteria ? Users can be able to add as many Names

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.