Sending 0 byte file while request.body.read is not empty

Archived from the Transloadit support forum. Originally posted on October 2, 2011; details may be outdated, see our docs for current behavior. Original thread

Hi,

I’m using transloadit and sending files with xhr using valumns file uploader.

Files are sent to the server without errors (i checked size and content of request.body.read) but once I do:

response = assembly.submit! (request.body)

An empty file is sent (I checked many times in the assemblies history page).

Thanks for you help.

I’m using transloadit and sending files with xhr using valumns file uploader. response = assembly.submit! (request.body)

I’m confused, the above code is not JavaScript, right? But since you mentioned XHR requests I’m very confused.

Sorry, I’ll clarify :

I’m using sinatra (ruby) with transloadit.

response = assembly.submit! (request.body) if a ruby method for sending files available in the transloadit gem.

Update:
It’s wired. I found that when I send files with size > 120Ko it works, but it sends an empty file if the size is less than 120Ko [±] 5ko.

It’s wired. I found that when I send files with size > 120Ko it works, but it sends an empty file if the size is less than 120Ko [±] 5ko.

I’m confused, What is a Ko? Do you mean Kb?

And what do you consider to be an empty file? To me an empty file is 0 bytes, but you are also talking about empty files < 120 Ko? Can you explain further?

Support I have a file A with size 130Kb.

The file A is sent without any problems.

But when I send a file B with size, let’s say, 40Kb.

The file B is not sent correctly. Because transloadit receives an empty (0 bytes) file.

I tried that using different size and always the same thing happens.

If the size of a file is more than 120kb, everything works.
But when the size of a file is less than 120kb, transloadit receives an empty file.

Hey Yassine,

thanks for your report.

I tried to upload an 8KB file to one of our image resize demos here: http://transloadit.com/demos/image-resize/resize-to-75x75

Can you confirm that your problem exists there as well?

If not, can you please point me to an assembly id of yours where this problem occurred?

Kind regards,
Tim

Hi Tim,

Thanks for your reply.

I tried the demo you in the page you sent me and it works with any size.

Here is an assembly id that received an empty file (original size 47kb)
REDACTED

Thanks for your help !

Hey Yassine,

hm this is weird. Your template looks fine. Do you have this online somewhere for me to test your form?

Hey Yassine,

have you lost track of this ticket?

Closing this for now.