Welcome Guest, Not a member yet? Register   Sign In
Bypassing upload_max_filesize
#1

[eluser]TheFuzzy0ne[/eluser]
Hi everyone.

I have a big problem. I am creating an application, that should allow uploads of PDF files that are around 25 MB long, the only problem is that it's currently set to 2M, and the access level is 6, so there's no way for me to override it. Can anyone think of an elegant solution around this problem that doesn't involve and FTP client?

Many thanks in advance.
#2

[eluser]pistolPete[/eluser]
Is using a perl script an option?
If so, have a look at: http://www.raditha.com/megaupload/upload.php
#3

[eluser]TheFuzzy0ne[/eluser]
I'd rather not, but it appears that I may have run out of possible options. The thought had occured to me, but I wasn't sure how difficult it would be to integrate with my CodeIgniter app (as I'm a bit of a Perl noob). I guess I should start looking into it.

Thanks.
#4

[eluser]TheFuzzy0ne[/eluser]
I'm not sure how I can integrate this with CI and form validation. Any suggestions?
#5

[eluser]pistolPete[/eluser]
After the upload is finished, the perl script could send a post request to your CI controller containing the filename and all other form data.
Or you try to integrate perl and php like it is done here: http://www.linuxjournal.com/article/9282
#6

[eluser]TheFuzzy0ne[/eluser]
I don't believe I can install CPAN modules, so the second option is out.

As for the first option, I have no idea how to handle permissions, so that only authenticated users or admins can upload a file. I also don't have a clue how to pass cookie data from one script to another. Sorry for being thick.
#7

[eluser]pistolPete[/eluser]
I am not a perl guru myself, but you can access cookie data in perl using CGI::Cookie.

After uploading finished, send the post request using LWP::UserAgent and HTTP::Request.

Regarding permission handling, you can read the cookie and query a database just like you do in php.

But as this all seems pretty hard to do (and far from "elegant" as you requested above), I'd rather look for an option to increase your upload_max_filesize setting.
#8

[eluser]TheFuzzy0ne[/eluser]
I think I'm just going to have to just resort to FTP. Sad

Thanks a lot for your help, though.

PistolPete, meet Pissed Ole Fuzzy. Tongue
#9

[eluser]TheFuzzy0ne[/eluser]
Does anyone know if there's some kind of Java applet that can split files up and send them in pieces?
#10

[eluser]pistolPete[/eluser]
If you want to use a java applet, you could use one to upload to ftp as well (without splitting).




Theme © iAndrew 2016 - Forum software by © MyBB