Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

233
Views
file.size of input type "file" not getting actual size of file on iOS

I'm trying to validate max file size of 5MB, and it works on PC, on android phones, but fails everytime i use an iPhone. If i try to upload a photo of 6MB from a iPhone, it passes the validation but fails later because of my <jsonSerialization maxJsonLength="5000000"></jsonSerialization> restriction, and returns "Message": "Maximum request length exceeded." as expected.

So i added these lines on my $('input[type=file]').change(function):

var tam = $(this).get(0).files[0].size;
tam = tam / 1024;
alert('File size with division:' + tam);

And i get the alert saying that the 6MB photo in question has less than 4MB (3425kb), the code continues and then i get Maximum request length exceeded error.

I'm using:

  1. asp.net Web Forms
  2. .NET framework 4.6
  3. bootstrap 4.6
  4. bs-custom-file-input (plugin recommended by bootstrap)

Like i said, i'm only getting this error on iPhones.

Thanks in advance

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!