SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Addict
    Join Date
    Sep 2008
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    uploading flv file

    Want upload flv file through php.

    1) Is there a limit size for the file to be uploaded?
    2) How to solve the page time out issue during the upload.


    i need to upload flv files through php, like i uploaded pdf files and images before, but the problem is the flv file sizes.

    how to upload a flv file i need a full function to solve this problem for me

    plz i need advice ...
    thnk for replies in advance

  2. #2
    PHP Guru lampcms.com's Avatar
    Join Date
    Jan 2009
    Posts
    921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by john_zakaria View Post
    Want upload flv file through php.

    1) Is there a limit size for the file to be uploaded?
    2) How to solve the page time out issue during the upload.


    i need to upload flv files through php, like i uploaded pdf files and images before, but the problem is the flv file sizes.

    how to upload a flv file i need a full function to solve this problem for me

    plz i need advice ...
    thnk for replies in advance
    just upload flv like any other file
    all you need it to change the value of
    upload_max_filesize in php.ini
    for example:
    upload_max_filesize = 24M

    You don't have to change the max_execution_time value because upload time does count as part of execution time in php

  3. #3
    SitePoint Addict
    Join Date
    Sep 2008
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Sharedlog.com View Post
    just upload flv like any other file
    all you need it to change the value of
    upload_max_filesize in php.ini
    for example:
    upload_max_filesize = 24M

    You don't have to change the max_execution_time value because upload time does count as part of execution time in php
    i want to know if i have a big file and i want to upload it through php but my probelm is when uploadding bigger size ... coz the explorer timeout cannot perform it , it show for me "PAGE CANNOT BE FOUND".


    all i want to know is how to know the php timeout for uploading files and how to increase it ...

  4. #4
    PHP Guru lampcms.com's Avatar
    Join Date
    Jan 2009
    Posts
    921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If a file is so large that your browser times out, then it's a browser issue, and there is nothing you can do on a server side to prevent that.

    You may consider using ftp for uploading such large files.

  5. #5
    SitePoint Addict
    Join Date
    Sep 2008
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i want the administrator of the website to upload the flv file by himself without the need to contact me..
    Got it?

  6. #6
    SitePoint Addict
    Join Date
    Jul 2008
    Posts
    213
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As Sharedlog wrote, if the issue is PHP based you will need to change the PHP configuration setting for 'upload_max_filesize' to a higher file size limit. I would also suggest changing the 'post_max_size' setting to the same file size. You can do this by changing them directly via the php.ini, or using the code below in your script before your upload code is executed.

    PHP Code:
    ini_set('upload_max_filesize','50M');
    ini_set('post_max_size','50M'); 

  7. #7
    SitePoint Addict
    Join Date
    Sep 2008
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by spiderling View Post
    As Sharedlog wrote, if the issue is PHP based you will need to change the PHP configuration setting for 'upload_max_filesize' to a higher file size limit. I would also suggest changing the 'post_max_size' setting to the same file size. You can do this by changing them directly via the php.ini, or using the code below in your script before your upload code is executed.

    PHP Code:
    ini_set('upload_max_filesize','50M');
    ini_set('post_max_size','50M'); 

    I tried to echo the new values :

    Code:
    <?
    
    ini_set('upload_max_filesize','50M');
    ini_set('post_max_size','50M');
    echo "post_max_size = " . ini_get("post_max_size") . "\n";
    echo "upload_max_filesize = " . ini_get("upload_max_filesize") . "\n";
    echo "max_input_time = " . ini_get("max_input_time") . "\n"; 
    
    ?>
    but it did not work in the echo.. it shows the old values...

    how to set new values in 'upload_max_filesize','post_max_filesize',......???

    plz i need help

  8. #8
    PHP Guru lampcms.com's Avatar
    Join Date
    Jan 2009
    Posts
    921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by john_zakaria View Post
    I tried to echo the new values :

    Code:
    <?
    
    ini_set('upload_max_filesize','50M');
    ini_set('post_max_size','50M');
    echo "post_max_size = " . ini_get("post_max_size") . "\n";
    echo "upload_max_filesize = " . ini_get("upload_max_filesize") . "\n";
    echo "max_input_time = " . ini_get("max_input_time") . "\n"; 
    
    ?>
    but it did not work in the echo.. it shows the old values...

    how to set new values in 'upload_max_filesize','post_max_filesize',......???

    plz i need help
    I think you cannot set these from php script, only from php.ini and also you need to restart the server after the change.

    Make sure to also set the
    memory_limit to a value larger than post_max_size and upload_max_filesize

  9. #9
    SitePoint Addict
    Join Date
    Sep 2008
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Sharedlog.com View Post
    I think you cannot set these from php script, only from php.ini and also you need to restart the server after the change.

    Make sure to also set the
    memory_limit to a value larger than post_max_size and upload_max_filesize
    Sorry but the value did not change neither from php.ini nor from php script.
    I tried to make restart to the wamp5 server but it did not show anything

  10. #10
    SitePoint Addict
    Join Date
    Jul 2008
    Posts
    213
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The ini_set is only at runtime of the script. Once the script has completed executing it will revert to the original setting. Restarting the server does not have an affect with this method.

    Have you tried uploading a file larger than the default maximum and smaller than your ini setting to see if the upload works?

    I too tried echoing the ini values and the default values were shown even though I set it higher. However, I was still able to upload files larger than the default value.


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
  •