/    Sign up×
Community /Pin to ProfileBookmark

upload problem

Hello, i have this problem, i need to let users to upload files up to 10 MB, the thing is that i need to increase the time before the page expires in order to let the user upload the file, and i need to increase hte upload_max_filesize variable of PHP to 10MB, but i need to do this on demand, i cant modif the php.ini…

Could anyone hlp me with this 2 things?

thx for ur time

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@bokehFeb 02.2006 — This [B]cannot [/B]be modified on demand from within the script. This is because the upload occurs before the script runs. If you cannot access php.ini you can make these changes in .htaccess if you are on apache.
Copy linkTweet thisAlerts:
@katasovaauthorFeb 02.2006 — i see, thank you.

Now, once, long time, ago i read a way to increase the time before page expires, it wasnt necesary to modify the .ini, i remember it was more like a trick. Im not sure how i just remember we cheat the browser somehow...

Any idea on how to do this? i just cant find the article :rolleyes:

thx again
Copy linkTweet thisAlerts:
@bokehFeb 02.2006 — Not in PHP
Copy linkTweet thisAlerts:
@katasovaauthorFeb 02.2006 — i found the article ?

u can change the time limit using 1 of this 2:

[code=php]ini_set('max_execution_time', 300);[/code]

or this one:

[code=php]void set_time_limit ( int seconds )[/code]

'When called, set_time_limit() restarts the timeout counter from zero. In other words, if the timeout is the default 30 seconds, and 25 seconds into script execution a call such as set_time_limit(20) is made, the script will run for a total of 45 seconds before timing out. '

just in case someone need it....

As bokeh said it is impossible to change the max size of files using ini_set() but at least u can change he time out :rolleyes:

thx again for ur time
Copy linkTweet thisAlerts:
@bokehFeb 02.2006 — Oh dear. That has nothing to do with file uploads. That is execution time. What you need to change is max_input_time and max_upload_size neither of which can be changed runtime.
×

Success!

Help @katasova spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...