Cannot upload files larger than 30MB to Amazon - file-upload

Our site is hosted in Amazon EC2 server and files are stored in Amazon S3 server.
My problem is when I upload files larger than 30MB, uploading failed. Does not display any error, but connection reset. the page display like this
The connection was reset
The connection to the server was reset while the page was loading.
The site could be temporarily unavailable or too busy. Try again in a few moments.
If you are unable to load any pages, check your computer's network connection.
If your computer or network is protected by a firewall or proxy, make sure
that Firefox is permitted to access the Web.
But if I upload smaller than 30 MB there is no issue or error. Please help me in this issue.
In my config file we are using
<httpRuntime executionTimeout="120000" maxRequestLength="1048576"
useFullyQualifiedRedirectUrl="false"/>
so that, it should allow around 1GB file.
We are using single part uploading, in Amazon document says that single part uploading also allow 1byte to 5 Gb, then what is the issue?
Please help me soon

Related

Guacamole SFTP not working for larger files

I am using guacamole to connect to remote devices over RDP for Windows machines and SSH for Linux. Now I would like to enable SFTP support for the connections so I enabled the option 'Enable SFTP' in the guacamole connection settings.
The problem is SFTP is working for smaller files (<3KB), creates 0KB files for slightly larger files (3KB-150KB) and raises internal error for larger files (>150KB). I checked for what file size SFTP is failing by trial, transferring files of different sizes to the remote machine.
In the screenshot, it can be seen that 'attendance.py' a smaller file of size 548 bytes is successfully transferred to the tmp folder in the Linux machine, but the other two files files are created as empty files. The pdf file I tried to move is close to 180KB, which raises a Internal Error. I checked if there is some dependency with this error and filetype but this problem occurs for all file formats. I have the same problem when transferring file to a windows machine configured with RDP protocol in the same guacamole server.
Can someone help me with this? Thanks in advance
Are you using a reverse Proxy?
I had the same problem by using nginx. It seems it is by default not allowing files greater than 1MB.
I could change that at nginx to any size and now it works.
For nginx look for: client_max_body_size
If you are not using nginx, i would take a look at the webserver config. Remember, you using some sort of a webserver and a filelimit is there usualy very much needed.

Transfer from one cPanel to another cPanel without WHM access

I have cPanel access on two different servers and would like to transfer from one server to another. The original size of the account on the first server is close to 15GB.
Currently, the only two ways I can think of are:
Backup using cPanel then Restore on the second server. But this process times out. I get "Failed - Network error" error
Use FTP App like Filezilla to login and transfer files from that. I haven't tested this but I think it first downloads the files on my local machine (temp folder) then uploads them to the second server.
My problem with option 2 is that this means I will end up using 30GB of data transfer if it actually does that.
What is the best way to transfer from server to server using cPanel?
I have limited knowledge on this. I will suggest you some tips.
1.Backup using cPanel then Restore on the second server. But this process times out. I get "Failed - Network error" error
The backup creation is failed due to the high size of account. So that reason that way is not possible.
Use FTP App like Filezilla to login and transfer files from that. I haven't tested this but I think it first downloads the files on my local machine (temp folder) then uploads them to the second server.
You can download the whole content to your PC or download one folder by folder like first home, mail, and etc and upload to new cpanel account using ftp
Could you please open a support ticket to your hosting provider they will help you create from server backend using /script/pkgacct.
Thank you.

Script timeout passed, if you want to finish import, please resubmit same file and import will resume

I have an sql file which I want to upload in my database in live server using Cpanel. The size of it is 8.36 mb. But the server showing me this error.
NB: I found several answers which shows me to configure php.ini file located in localhost. But in this case, I'm working with live server, and in the Cpanel I've no access in root files.
Please contact your hosting provider and ask them to increase max execution time and upload limit, You can not increase it with your cPanel access.

AWS s3 configuration to avoid waiting time for multiple request

I have static content uploaded on S3 bucket.
When I hit URL for the First time, the contents take while to load. It has a single html page with multiple CSS and JS.
So is there any kind on configuration needed at S3 level to optimize.
I am trying to figure out settings such as number of connections like we have in Apache.
There are no configurations available for Amazon S3. It just works!
Some ideas for speeding your download:
Create a bucket that is located closer to you/your users (less latency)
Zip your files before uploading to Amazon S3 (faster download)
Check the Network console in your web browser to determine where the time is being taken

How to upload files directly to Amazon S3 from a remote server?

Is it possible to upload a file to S3 from a remote server?
The remote server is basically a URL based file server. Example, using http://example.com/1.jpg, it serves the image. It doesn't do anything else and can't run code on this server.
It is possible to have another server telling S3 to upload a file from http://example.com/1.jpg
upload from http://example.com/1.jpg
server -------------------------------------------> S3 <-----> example.com
If you can't run code on the server or execute requests then, no, you can't do this. You will have to download the file to a server or computer that you own and upload from there.
You can see the operations you can perform on amazon S3 at http://docs.amazonwebservices.com/AmazonS3/latest/API/APIRest.html
Checking the operations for both the REST and SOAP APIs you'll see there's no way to give Amazon S3 a remote URL and have it grab the object for you. All of the PUT requests require the object's data to be provided as part of the request. Meaning the server or computer that is initiating the web request needs to have the data.
I have had a similar problem in the past where I wanted to download my users' Facebook Thumbnails and upload them to S3 for use on my site. The way I did it was to download the image from Facebook into Memory on my server, then upload to Amazon S3 - the full thing took under 2 seconds. After the upload to S3 was complete, write the bucket/key to a database.
Unfortunately there's no other way to do it.
I think the suggestion provided is quite good, you can SCP the file to S3 Bucket. Giving the pem file will be a password less authentication, via PHP file you can validate the extensions. PHP file can pass the file, as argument to SCP command.
The only problem with this solution is, you must have your instance in AWS. You can't use this solution if your website is hosted in other Hosting Providers and you are trying to upload files straight to S3 Bucket.
Technically it's possible, using AWS Signature Version 4, Assuming your remote server is the customer in the image below, you could prepare a form in the main server, and send the form fields to the remote server, for it to curl it. Detailed example here.
you can use scp command from Terminal.
1)using terminal, go to the place where there is that file you want to transfer to the server
2) type this:
scp -i yourAmazonKeypairPath.pem fileNameThatYouWantToTransfer.php ec2-user#ec2-00-000-000-15.us-west-2.compute.amazonaws.com:
N.B. Add "ec2-user#" before your ec2blablbla stuffs that you got from the Ec2 website!! This is such a picky error!
3) your file will be uploaded and the progress will be shown. When it is 100%, you are done!