Any luck using the API to upload a 1.5gb+ file on a Shared Host using PHP

  • 1
  • Question
  • Updated 3 years ago
  • (Edited)
Hi there, we are a print press who would like to incorporate a mini upload functionality into a part of our working site. The issue I face is the site is in a shared hosting and using the API I haven't been able to successfully upload a file larger that 1gb, our target is around 2gb. I have tried manipulating execution limits and upload /post limits to no avail. Can anyone suggest a reliable working means of accomplishing this? 
Thank you.
Photo of Trogba

Trogba

  • 16 Posts
  • 1 Reply Like

Posted 4 years ago

  • 1
Photo of Eliezer Encarnacion

Eliezer Encarnacion, Software Engineer

  • 732 Posts
  • 102 Reply Likes
Hi Toba,

What happens when you try to upload larger than 1 gb? Is there an error message?

Eli
Photo of Trogba

Trogba

  • 16 Posts
  • 1 Reply Like
Hey Eliezer, 
Thanks for getting back to me.
Once I hit submit the file starts the initial upload process, (where you see the progress in the status bar of your browser) and once that completes I then get the "waiting for response from server", and shortly after I get a NO DATA PROVIDED message, I am currently working on reproducing the error to provide a better description.
 
Photo of Trogba

Trogba

  • 16 Posts
  • 1 Reply Like
Sent!
Thanks
Photo of Eliezer Encarnacion

Eliezer Encarnacion, Software Engineer

  • 732 Posts
  • 102 Reply Likes
Thanks, I'll take a look now.
Photo of Eliezer Encarnacion

Eliezer Encarnacion, Software Engineer

  • 732 Posts
  • 102 Reply Likes
Hey Toba,

I tried using your page. I was able to successfully upload  a 1 GB file, but the page broke when uploading a file with 1.8 GB. It looks like the file is first uploaded to the server and then the server initiates the upload to ShareFile. Am I correct?

I checked our logs and it doesn't seem the file ever reached our servers. Shared hosts vary in their capabilities, but they usually have limited processing power. Uploading a 1.5+ gb file is quite work and it may be your current hosting solution is able to handle that. Since the issue here is not with ShareFile, there isn't anything we can fix on our end.

However, we can give you some recommendations. If you're not able to move your app to a different hosting solution, you should move your upload logic to the client-side of your app (the browser). Instead of uploading the file to your server, and then from your server to ShareFile, allow the client to upload to ShareFile directly. You can do this by implementing the upload logic on JavaScript. However, because this is such a common use case, we already have a utility called the "Remote Upload Form" you can use, and which we strongly recommend. You can read more about it here:https://support.citrixonline.com/en_US/ShareFile/help_files/SF040020?title=Remote+Upload+Form

Let me know if there's anything else I can help.

Thanks,
Eli
Photo of Trogba

Trogba

  • 16 Posts
  • 1 Reply Like
Hi Eli,
I've been off doing my best to learn and implement your api using the threaded upload option. I am new to implementing Rest API's so it's been a bit of a challenge, but a very promising one indeed. I was able to get past a few issues on my own, including an issue with Access-Control, another with missing parameters and another with NULL Chunk. I am proud to say I am now able to send data across to your servers and get a success response but I still don't see the files in my folder.
Can you please check if your logs have any clues as to what is going on. If you need further directives on what is going on I can send you a link to the site and/or my source code to check it out for yourself.
Thanks
Toba
Photo of Eliezer Encarnacion

Eliezer Encarnacion, Software Engineer

  • 732 Posts
  • 102 Reply Likes
Toba,

The error I see more often on the logs is "No filename provided for upload." Does that sound like the issue you are seeing? That error would generate a 400 response, rather than a 200. 

Is the success response coming when posting the file to the storagecenter url (https://storage-us-2...)? If so, it can be misleading. We recommend that you not only rely on the response code, but that you actually parse the response body. Sometimes the storagecenter component returns a 200 OK response, but the body will say something like "Error: <reason>". That could be what you are seeing. Give it a try and let me know if you can identify the reason your files are not uploading. 

Thanks,
Eli