Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: ?? HOW TO display error message when file too large ??

  1. #1
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default ?? HOW TO display error message when file too large ??

    Hey kids,

    Right now if a video is over the alloted 100M for uploading and a person tries to upload a video larget than 100M, what's displayed is a server connection error, which doesn't help the unsuspecting user know that the file s/he's trying to upload has exceeded the allowed upload size.

    How do I get it to return an error saying, "Sorry, the file you're trying to upload exceeds 100M" :?: Would that be some kind of .htaccess thingie :?:
    If it's not fun, stop doing it!

  2. #2

    Default Re: ?? Getting Error Message to display when file size too large


  3. #3
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default Re: ?? Getting Error Message to display when file size too large

    NO, no, that is not my issue. Trust me, I know how to get the files sizes allowed.

    What I want is a page that displays an error saying that the file is too large when they try to upload a file larger than the alloted 100M (which is the limit for my sites, even though my host has 200M by default).

    I only allow 100M sized videos on my site. Person tries to upload video 110M...they get "server connection error". It doesn't tell them that the file they tried to upload is too big. I need an error page telling them that they exceeded the file size upload...something along the lines of a file status...'We're sorry but your video file is too large, please reduce the size to 100M or less and try again"...something like that.
    If it's not fun, stop doing it!

  4. #4
    Join Date
    Sep 2008
    Posts
    1,019

    Default Re: ?? HOW TO display error message when file too large ??

    Open up your upload.tpl file and find the following code:

    Code:
    <input type="hidden" name="MAX_FILE_SIZE" value="1048576000">
    Remove one of the zeros at the end so that it looks like:

    Code:
    <input type="hidden" name="MAX_FILE_SIZE" value="104857600">
    I believe that this was supposed to be like the second one from the beginning, but someone may have fat-fingered the number (this is based on the fact that 100MB is the file size that is listed in the template by default). What this is intended to do is to pass a variable into PHP which tells PHP (from the browser side) what the maximum allowed file size should be. If a person attempts to upload a file bigger than this, you'll get a browser based error that the user can see before the upload even takes place. Without this (or in our case, this being incorrect), the file proceeds to upload until it hits the server's hard limit. When this happens, PHP refuses to accept anything further and a connection timeout is eventually displayed.

    For your notes, the number is your maximum file size in bytes. The new number, 104857600, is 100MB in true bytes. The original number, 1048576000, is 1GB in true bytes. As originally written, you would never get an error until you upload a file bigger than 1GB, lol.
    vShare Solutions
    Custom vShare Modules and Services

    Now, your visitors can watch videos on your site using their mobile or tablet device with the Mobility Mod for vShare 2.8!

  5. #5
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default Re: ?? HOW TO display error message when file too large ??

    I have the 100M set in the .htaccess (my host doesn't use php.ini) and I noticed the number in the upload.tpl but didn't think much of it because of the .htaccess rule, but I'll see if this makes a difference and report back. Thanks!!
    If it's not fun, stop doing it!

  6. #6
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default Re: ?? HOW TO display error message when file too large ??

    Just as I thought, that had absolutely no affect (since if it's doing this with a 173M file which is well under 1 gig...).

    Here's what I did:

    I have the upload on all my sites limited to 100M.

    I just tried to upload a file that was 173M. When I hit the upload button, I got this error message:

    Connection Interrupted
    The connection to the server was reset while the page was loading.
    The network link was interrupted while negotiating a connection. Please try again.
    Which is from the server. This just looks really bad. I was hoping that I could get a page that detects the size of the file a person is attempting to upload and display an error instead, like "sorry, that file is too big, try reducing the file size and uploading again blah blah blah".

    What I'm thinking is like with error documents, you can manipulate those with .htaccess..like instead of a person getting the dreaded "page not found" error, you can re-direct them to another page on your website like this:

    Code:
    ErrorDocument 404 http://yourdomain.com
    Which would take the 404 error and make it go to your home page.

    Side Note: This is also good for "hiding" affiliate links. ;)
    LIke if your affiliate link is 6 miles long you could do this in .htaccess:

    Code:
    Redirect 301 /affiliate http://my6mile.com/long/affiliate/link.html
    By making your affiliate link like this on your web page:
    Code:
    my link here
    If it's not fun, stop doing it!

  7. #7
    Join Date
    Sep 2008
    Posts
    1,019

    Default Re: ?? HOW TO display error message when file too large ??

    By removing the "zero" you are basically changing it from 1GB to 100MB. Which of your sites is doing this? That way, I can tell you whether or not you can manipulate the page with .htaccess or not.
    vShare Solutions
    Custom vShare Modules and Services

    Now, your visitors can watch videos on your site using their mobile or tablet device with the Mobility Mod for vShare 2.8!

  8. #8
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default Re: ?? HOW TO display error message when file too large ??

    It happens on all of my sites. Maybe I need to contact tech support at my host?

    If you try to upload a file bigger than allowed on your site, do you get the connection error or do you see something saying" sorry the file is too big"?

    One thing I did notice is this which is referencing the uu_upload.pl (don't know if this matters or not but this is the address that appears in the browser addy window):

    Code:
    http://mydomainname.com/cgi-bin/uu_upload.pl?temp_sid=6b7a325c755c95c3b376c92abb088c46
    I'm googling this now, it has to do with "file handler" or something... like it's not detecting that the file is too big and returning the person to a page telling them that the file is too big.
    If it's not fun, stop doing it!

  9. #9
    Join Date
    Sep 2008
    Posts
    1,019

    Default Re: ?? HOW TO display error message when file too large ??

    Ahhhh.... well poo:

    That's the problem right there. I didn't even notice that until you pointed it out. If you are using the upload progress bar, that script that your form is posting to is written in Perl, not PHP. Thus, the MAX_FILE_SIZE thing will not work (as that is a PHP function). I'll have to see if there is a workaround to this.
    vShare Solutions
    Custom vShare Modules and Services

    Now, your visitors can watch videos on your site using their mobile or tablet device with the Mobility Mod for vShare 2.8!

  10. #10
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default Re: ?? HOW TO display error message when file too large ??

    So if I disable the upload progress bar, I will get an error message instead of the server connection error? DANG! I like the little bar thingie! LOL
    If it's not fun, stop doing it!

Page 1 of 2 12 LastLast

Similar Threads

  1. error message
    By Dowis in forum Bug Reports
    Replies: 1
    Last Post: 02-10-2009, 03:53 AM
  2. error message
    By berry05 in forum Installation Support
    Replies: 1
    Last Post: 04-12-2008, 04:38 AM
  3. Uploading large files error
    By wannaclip in forum Fixed Bugs
    Replies: 16
    Last Post: 07-07-2007, 08:51 AM
  4. Setting php.ini for Large File Uploads
    By admin in forum Frequently Asked Questions
    Replies: 0
    Last Post: 06-08-2007, 05:08 PM
  5. Won't allow large file uploads
    By mersh in forum Installation Support
    Replies: 1
    Last Post: 06-08-2007, 04:42 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •