File transfer problem

Hello,

my scenario is that i’m using Flex to upload to a remote server. there
are two servers involved…one that runs the web app and one that only
stores the file. everytime i do this i get an io error…once, i hit
the upload button again and it actually did the upload so i decided to
write the code to do the upload twice (awful hack i know) which works
only for smaller files. Larger files appear as though the upload is
happening but still zero length…everything appears to be happening but
the actual writing of the file…i think this is related to sessions but
have no way to know for sure what’s happening…is there a way to
increase the time a session is established?

thanks much

I’m not sure if this is what you are looking for, but the session
cookies don’t get sent by flex/flash when you upload a file. I had to
make a request before the file upload to get a unique upload id, store
it the database and return it to flex. Then when I acually send up the
file I tag it in the params of the upload.

I’m interested to know if anyone came up with a other workarounds for
the problem?

On Jul 25, 4:00 pm, Percy K. [email protected]

On 26 Jul 2009, at 10:15, Josh wrote:

I’m not sure if this is what you are looking for, but the session
cookies don’t get sent by flex/flash when you upload a file. I had to
make a request before the file upload to get a unique upload id, store
it the database and return it to flex. Then when I acually send up the
file I tag it in the params of the upload.

I’m interested to know if anyone came up with a other workarounds for
the problem?

For more recent versions of Rails (afaik 2.3 or higher):
http://thewebfellas.com/blog/2008/12/22/flash-uploaders-rails-cookie-based-sessions-and-csrf-rack-middleware-to-the-rescue

If you’re using an older Rails version, you can check out a post I
made quite a while ago:
http://www.ruby-forum.com/topic/161291

Best regards

Peter De Berdt

Hi Peter,

I’ve seen both of these posts, and I’ve implemented the middleware
solution…ironically…i have no problem uploading to the server
hosting the web-app…but the problem appears when writing the file to
the storage server which is auto-linked through nfs…it works fine for
smaller files, but when i tried to write a 12MB file it fails…is there
a separate session being established by the storage server or is there a
session i can get from the server running the web-app in this situation
(prolonged file transfer).

thanks again

percy

Peter De Berdt wrote:

On 26 Jul 2009, at 10:15, Josh wrote:

I’m not sure if this is what you are looking for, but the session
cookies don’t get sent by flex/flash when you upload a file. I had to
make a request before the file upload to get a unique upload id, store
it the database and return it to flex. Then when I acually send up the
file I tag it in the params of the upload.

I’m interested to know if anyone came up with a other workarounds for
the problem?

For more recent versions of Rails (afaik 2.3 or higher):
http://thewebfellas.com/blog/2008/12/22/flash-uploaders-rails-cookie-based-sessions-and-csrf-rack-middleware-to-the-rescue

If you’re using an older Rails version, you can check out a post I
made quite a while ago:
Need help selecting a good upload plugin - Rails - Ruby-Forum

Best regards

Peter De Berdt

Hi Josh,
I’m interested in what you said here:

to get a unique upload id,

where is this unique upload id and how did you get it? i’m new to ruby
so although it makes sense i don’t know all the api. are you refering
to the authenticity token?? i’ve turned mine off so is there another
unique id i don’t know about?

many thanks

percy

Hi Zie,
Excellent suggestions…i’ll give it a shot.

percy

Hey Percy,

This sounds like a really strange problem. I am thinking a little out
of the box here, but this sounds like a classic clustering issue. One
server within the cluster has a different code set or is not working
correct. Hence you get this case of “it sometimes works and other
times it doesn’t”. Double check that all your mongrel, or whatever you
are running, have restarted properly and are running all the same
code.
I would highly doubt that this is problem with your flex code if you
can upload the file properly, even if it is really small. Double check
that file is not corrupt on the other end though. If you could replace
your flex code with something else that can handle the same sort file
transfer, that could isolate the problem.

The only other thing I could think of is a bug within the front end
server which is handling the file transfer.

Good luck,

Ziemek

On Jul 26, 3:37 pm, Percy K. [email protected]