About file upload on Mac plugin


#1

Hi,jules
How is it going?
I use Url class to do fileupload.
I create a fileUploadThread for each upload file.
on windows, firefox plugin upload works good. I can upload 30MB files.
on Mac, when I upload a small size file, it works.
However, when I upload a file with size 30MB, firefox crashes.
I found the firefox crash message from /Applications/Utilities/Console.
It gives me “exc_bad_access” firefox crash message.
The way I implement the uploadThread is :(part of the code)

juce::InputStream* input = url.createInputStream(true,fileUploadStatus);

/once the upload is done, it will go to the next block to check/

if (0 == input->read((void*) *m_xmlResponse, 2048)) {
*m_uploadStatus = -2; // couldn’t open the wav stream
return;
}

m_xmlResponse is char buffer, and pass to fileUploadThread by reference.

the crash happen in if (0 == input->read((void*) *m_xmlResponse, 2048)) check.

is it possible that timer out for input->read method?
because once the file uploaded completely, server will generate other types of files according to this uploaded files.
if file has small size, it takes less time to generate other files on server. so it works.

Thanks!
Leon


#2

There aren’t any size limits in there, so can’t think why it’d happen. Maybe you can send me a stack trace of the point where it crashes?


#3

pluginstarter, did you ever solve this issue?

I seem to be having the same problem.
Firefox & Safari (OSX) don’t crash, but freeze for the duration of the file upload, once it’s done uploading, they resume normally.

I’m also running the URL in a thread like so:

URL * url = new URL(httpURL); *url = url->withFileToUpload("file", file, "audio/wav"); url->createInputStream(true);

when createInputStream is called, the browser freezes :shock:.
Am i doing something wrong?


#4

ähem, the solution was to put

into the Thread’s run() function :roll: