I need a flash uploader, to use it in my CMS project.
I need something like this, but with greater max upload size (it doesn't allow to upload files larger ini_get('upload_max_filesize')).
My server doesn't allow me to overwrite ini settings, so I'm looking for an uploader which can upload large files independently from the ini settings.
If you want to go around the ini limit, one option would be to change and use an FTP uploader.
I've used once net2ftp and it was easy enough in its installation; I've never used it again since (almost 1 year and a half), but I see from their page that the project is updated and not dead, so you might give it a try.
You just download the package, place it in your webapp, customize it, and you're set.
You might want to create a dedicated FTP user with appropriate permissions, and not use the root one, of course.
You wont be able to post more data to the server than the max_upload_size.
As a workaround you can upload the data to Amazon S3 and sync it back via s3sync.
We have a setup with plupload in place for one of our clients and are able to upload up to 2GB per file (that's a client restriction, I don't know about S3 restrictions)
Mind you that S3 costs some money.
Related
I hope you are well.
I am creating a Learning Platform in pure PHP with MySQL and AdminLTE3.
I got to the time of creating the file manager for each user and got stuck on the following.
I have the following structure in folders:
/var/www/html/uploads/users/<% hash (USER ID)%>, and what I'm looking for is that each folder <% hash (USER ID)%> the maximum size is 2GB for each user.
I am using MacOs BigSur for development, but in production it will be on Ubuntu Server 18!
I am not trying set the max_file_size_upload, I am trying to set the maximum size of each user's folder to 2gb
Which type of files will it be? I would be a very wary of allowing users to upload arbitrary files to my web server. If they upload a .php file they would be able to run anything as the user running the webserver.
In fact, I would keep them in a database, and have fields to create the meta data instead. this way, you can compress and save the files, and store the size and filename as meta data. If you are using if for reference, etc, which does not need quick access, I would recommend this.
Alternatively, as this this linux.SE answer states, you could create a mounted folder for each user, and have the filesystem sort out everything regarding the quota. I would probably also look into chrooting the folders in some way. This would (in theory) also allow you to give them sftp/ssh access to the files.
I Would also look into doing everything in an environment similar to your production server. vagrant and docker spring to mind.
Alternatively, if all file uploads are handled by php, you could save the used file space and keep a running total, making sure in your php sript that they are nmot exceeding their quota.
I want to upload a large file from My computer to S3 Server without editing php.ini. Firstly,I choose file from browse button and submit upload button and then upload to s3 server. But I can't post form file data when I upload a large file. But I don't want to edit php.ini.Is there any way to upload a large local file to s3 server?
I've done this by implementing Fine Uploader's php implementation for S3. As of recently it is through an MIT license. It's an easy way to upload huge files to S3 without changing your php.ini at all.
It's not the worst thing in the world to set up. You'll need to set some environment variables for the public/secret keys, set up CORS settings on the bucket, and write a php page based on one of the examples which will call a php endpoint that'll handle the signing.
One thing that was not made obvious to me was that, when setting the environment variables, they expect you to make two separate AWS users with different privileges for security reasons.
ini_set("upload_max_filesize","300M");
try this
Okay, here's the rundown.
I'm developing a video hosting site with PHP and jQuery primarily. My client is absolutely set on using Filezilla to upload his videos via FTP instead of allowing me to handle the upload directly with PHP. This makes me mildly psychotic, but hey, the money man calls the shots.
Since I have no way of detecting the completion of those FTP uploads, I set him up with a special FTP account that is rooted into the uploads directory, and designed an interface that monitors that folder and allows him to start transcoding those files for web at his discretion. This is less than optimal. I'd like to show the progress of currently processing uploads on my mobile app, and hopefully start encoding files automatically when the FTP transfer completes.
So what I'm really asking for is either a method of detecting that a file is still being uploaded, or some way of finding the size of the original file that is being uploaded so that I can do comparisons.
Thanks!
On Linux, you can use fuser to see if a file's in use by a process. A more reliable option would be to use the inotify system, which'll give you realtime notifications of file change events.
In case anyone else is ever wondering, the answer to the question reached through the comments and more research on my end to confirm, is that the total size of a file is not passed to the server at all during ftp transfers. Thanks to Jonathan Amend.
My website allows users to upload photographs which I store on Amazon's S3. I store the original upload as well as an optimized image and a thumbnail. I want to allow users to be able to export all of their original versions when their subscription expires. So I am thinking the following problems arise
Could be a large volume of data (possibly around 10GB)
How to manage the download process - eg make sure if it gets interrupted where to start from again, how to verify successful download of files
Should this be done with individual files or try and zip the files and download as one file or a series of smaller zipped files.
Are there any tools out there that I can use for this? I have seen Fzip which is an Actionscript library for handling zip files. I have an EC2 instance running that handles file uploads so could use this for downloads also - eg copy files to EC2 from S3, Zip them then download them to user via Flash downloader, use Fzip to uncompress the zip folder to user's hard drive.
Has anyone come across a similar service / solution?
all input appreciated
thanks
I have not dealt with this problem directly but my initial thoughts are:
Flash or possibly jQuery could be leveraged for a homegrown solution, having the client send back information on what it has received and storing that information in a database log. You might also consider using Bit Torrent as a mediator, your users could download a free torrent client and you could investigate a server-side torrent service (maybe RivetTracker or PHPBTTracker). I'm not sure how detailed these get, but at the very least, since you are assured you are dealing with a single user, if they become a seeder you can wipe the old file and begin on the next.
Break larger than 2GB files into 2GB chunks to accommodate users with FAT32 drives that can't handle > ~4GB files. Break down to 1GB if space on the server is limited, keeping a benchmark on what's been zipped from S3 via a database record
Fzip is cool but I think it's more for client side archiving. PHP has ZIP and RAR libraries (http://php.net/manual/en/book.zip.php) you can use to round up files server-side. I think any solution you find will require you to manage security on your own by keeping records in a database of who's got what and download keys. Not doing so may lead to people leeching your resources as a file delivery system.
Good luck!
I'd like to have my PHP script upload a file with a certain filename in a directory of my choosing. However, the catch is that I need it to exist there immediately upon upload so I can moniter it on my server. I don't want to use a PHP extension or something - this should be very easy to transfer to any PHP setup.
So basically: Is there a way to guarantee that, from the very beginning of the file upload process, the file has a certain name and location on the server?
Not that I'm aware of.
PHP will use the php.ini-defined tmp folder to store uploads until you copy them to their correct location with move_uploaded_file(). So it's very easy to know its location, but the file name is random and I don't think you can define it.
If you're not going to have multiple concurrent uploads (for example if only you are going to upload files and you know you won't upload 2 files at the same time), you could check the most recent upload file in the tmp directory.
The common solution for monitoring uploads is apc.rfc1867
I know of three options:
RFC1867 (as mentioned by others) which allows you to poll upload progress using ajax
Flash-based uploaders like SWFUpload which allow you to poll upload progress using JavaScript
Create a PHP command line daemon listening on port 80 that accepts file uploads, and used shared memory (or some other mechanism) to communicate upload progress. Wish I could find the link, but I read a great article about a site that allowed users to upload their iTunes library XML file, and it was processed live by the server as it was being uploaded. Very cool, but obviously more involved than the previous options.
I have had decent luck with SWFUpload in the past.
I don't think you can configure the name, as it will be a random name in the temporary folder. You should be able to change the directory, but I can't seem to find the answer on Google (check out php.ini).
As far as I know, this isn't possible with PHP, as a file upload request submits the entire file to the system in one request. So there is no way for the PHP server to know what is happening until it receives the whole request.
There is not a way to monitor file upload progress using PHP only, as PHP does not dispatch progress events during the upload. This is possible to do using a Flash uploader even if Flash is uploading via a PHP script. Flash polls the temporary file on the server during the upload to dispatch progress events. Some of the javascript frameworks like YUI use a SWF to manage uploads. Check out YUI's Uploader widget.
http://developer.yahoo.com/yui/uploader/