Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-20-2008, 09:31 AM
Member
 
Join Date: Dec 2008
Posts: 12
Rep Power: 0
renuka_anil is on a distinguished road
Question saving bytes received in different request
Hi All,

Im new to forum and to java . Im devloping an application that uses HttpServlet for receiving request from mobile device.

Im uploading an image from mobile to server and saving it on server.

I am accepting one chunk in one request and saving it locally.
But i dont know how to save second chunk along with first. Means append next to previous.

Please need help. If any body knows please tell me.
If any can give code snippet then it will be great
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 12-20-2008, 09:33 PM
fishtoprecords's Avatar
Senior Member
 
Join Date: Jun 2008
Posts: 571
Rep Power: 2
fishtoprecords is on a distinguished road
Default
Duplicate post. Doing this discourages folks from being helpful
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 12-22-2008, 12:29 PM
Member
 
Join Date: Dec 2008
Posts: 12
Rep Power: 0
renuka_anil is on a distinguished road
Question Saving bytes received in different request
Hi,

Sorry for duplicate post. But I searched forum and i did not get anything regarding this. So, I posted it.

If you know any link or post regarding this then please let me know.

I need help coz im in very bad situation.

Thanks.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 12-23-2008, 08:44 PM
Steve11235's Avatar
Senior Member
 
Join Date: Dec 2008
Posts: 972
Rep Power: 2
Steve11235 is on a distinguished road
Default
Basically, what you need to do is save each chunk, and, when you have received all the chunks, you then retrieve them and process them.

If this is a small app on a single instance Web server, you can use a class with a static method to hold the chunks in a static HashMap. Be sure to synchronize! However, this will *not* work on a Web server farm.

You can also store the chunks in a database. That's a little more effort, but it will always work.

I suggest starting with the first approach as a prototype. Once the process works, use the database.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
saving bytes received in different request renuka_anil Java Servlet 18 12-26-2008 01:12 PM
How can you get the exact size of a file in bytes. J-Live New To Java 7 10-28-2008 02:41 PM
midi bytes willemjav Advanced Java 77 07-29-2008 04:10 PM
Reading bytes from InputStream Java Tip Java Tips 0 11-25-2007 08:51 PM
how to know the number of bytes gabriel New To Java 2 08-06-2007 06:13 PM


All times are GMT +2. The time now is 09:45 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org