Advanced Search

Results 1 to 2 of 2

Thread: Request for Max Upload Filesize Change

  1. #1
    Join Date
    Jun 2009
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Request for Max Upload Filesize Change

    Hey everyone..

    I would like to be able to upload .pdfs that are 30MB

    1. I am using Wordpress 8.4
    2. I am using Dreamhost and cannot locate either the php.ini or .htaccess file
    3. I don't have php.ini or .htaccess in my root folder via FTP
    4. I e-mailed Dreamhost and they said they cannot do it on their end

    I would like to know if I just create a php.ini file and if so can someone copy/paste the entire php.ini file that would allow me to upload up to 30MB files?

    OR

    I would like to know if I just create a .htacess file and if so can someone copy/paste the entire .htaccess file that would allow me to upload to to 30MB files?

    Thank you ahead of time

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,154
    Thanks
    260
    Thanked 690 Times in 678 Posts

    Default

    There may be a light workaround, but actually overriding php.ini is not possible if you don't have access.


    Your host may be intentionally stopping you and you should be very careful proceeding. There is no complete override, but you can try two temporary options:

    1. You can use .htaccess, such as here:
    http://www.whenpenguinsattack.com/20...erride-phpini/
    (Or google for something similar-- "override php.ini".)
    This is limited to one directory, however. You could copy multiple times if needed, but it won't change the setting systemwide.

    2. You can use values in the script itself.
    http://www.php.net/manual/en/function.ini-set.php
    This is limited to the individual script, each time it runs if this code is there. Make sure to keep it at the start of your code, so it can set it before anything else runs and causes confusion.


    However, your host may block (by rule or by force) these options. Be careful proceeding and keep the levels as low as possible to be sure you don't run into any serious problems (like overloading and crashing the server). That is-- this is at your own risk, and possibly against the TOS of the server. Even if it is technically possible, your host might fine/remove your account if it violates the agreement, so check on that first. (Likely more of an issue if you move on to unreasonable numbers, like 1GB files frequently, etc.)

    -------
    Aside from that, you must modify php.ini. If you do not have access to php.ini, then you host is intentionally stopping you.

    Get a new host, or find a new plan.

    php.ini creates somewhat of a security risk, thus some hosts choose to not allow access, because you changing values could cause problems for the server (like, for example, overloading it with huge files). While this particular issue is likely not going to do much harm, there are some settings that could actually damage the server/service (like changing the runtime limit to infinity, causing the server to go through endless loops forever and crash).

    There may be theoretically ways to try to get around it (such as finding a back door to the file, or creating another copy of the file [which should not work-- there's no reason it would]), but doing so is almost surely against the TOS from your host, and they should/would delete your account and/or fine you, etc.

    Sorry this isn't more helpful, but working within the bounds of limited hosting, there really isn't anything you can do.

    30mb isn't huge, and it seems reasonable that hosts would allow that, though most uploads by users are probably under a megabyte (things like posting a profile picture, etc.), so they may just not see the general need and unfortunately you don't fit what they think is "normal".
    I would guess that many/most hosts would allow up to 30mb, though I'm sure there is a reasonable limit on many sites. (You WANT a limit of some kind, or visitors could cripple your account with bandwidth and space overages; plus, large file uploads with simple forms are a pain anyway... better to use FTP.)

    There are few other options I can think of. One workaround would be to use another host to upload, then use the ftp functions in php to forward the file onto your other server. That is probably within the TOS, if used reasonably.

    You could use an archiving utility that will split the upload into smaller chunks, then put it back together on the server, somehow.

    You could use another language, or write an extension to PHP yourself (maybe look on google for an alternative to the defaults; someone might have written a class).

    You could always just use FTP if you are the only one operating the system-- and you could write a script around a directory where you upload files, so it would act basically like an upload script (if you want this so you can use php to do file management, database stuff, etc. with the uploaded files).
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

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
  •