views:

250

answers:

1

I am a new bee to ajax world. I am working on a site which uses jquery and codeigniter which processes big files like 2GB. It basically parses file and stores some extracted data from it, it uses ajax to show how far the files have been processed etc.

Now I want to change the way we process files. I want to first store the file on server side and then start the processing. I evaluated upload class of codeigniter but looks like I cannot use it for this purpose as this class works with field_name and I could not find a way to make an ajax call to the upload class.

My questions is : What would be suitable for my problem?

Thanks in advance,

Sam

A: 

To simplify your process, I would use uploadify to handle the 'progress' portion and send the whole thing to your upload controller - which could be handled by the upload class or the old fashioned way, the $_FILES array.

Dan Heberden
uploadify sounds good for progress but it would require flash?Looks like I have two approaches here :1. Use upload class of CI and from the same upload class do the processing as well2. Use $_FILES array to get file contents and store it in a location?Thanks a lot for your suggestions!
Sam
Since the jquery does the progress part by making ajax calls I was wondering if I can upload the file also in the similar fashion?
Sam
multipart-form/data can't really be sent over an XHR - the only way is to use an iframe to send the data and ping the request, but PHP doesn't have a "hey look at me and see where i'm at" feature :p Uploadify uses the flash FileReference class to get the progress on the client side of the upload and report it to you via javascript, then it (the flash object) sends it to the server.
Dan Heberden
As for the upload part on the server, you're correct - you can use their class or do it yourself. I'd take a stab at the class, it looks easy to use.
Dan Heberden