• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to upload a file of size >8GB ?

 
vinod perla
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
using InputStream I think it is not possible to upload a file which is greater than 2.14GB so, can anybody suggest me how to upload a file of size greater than 8GB?
 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont think that this is a kind of a mail -attachment...

whats the setup like?
 
vinod perla
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've to upload a file of size 8GB to a FTP server through a Java Application. Can anyone suggest any API/Any other way to handle it?
 
Pratik Patel
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you should use NIO. Take the input Channel from file's InputStream and output channel from the Socket of Remote server.

Read and write the data from input buffer to output buffer.
 
Joe Ess
Bartender
Posts: 9318
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by vinod perla:
using InputStream I think it is not possible to upload a file which is greater than 2.14GB


There is no size limit on a stream. If there is any size limit, it is determined by the operating system or the file system and no amount of magic at the application level will get around it (see here for a comparison of file system capabilities).
Using NIO will not get around any limitation, if one exists. The stream-style classes are implemented using NIO (that's why there's a channel available in the InputStream). NIO still has to obey limits set by OS and file system parameters.
Have you tried to upload an 8GB file? If so, what errors did you see? What OS/file system is the destination system?
[ March 23, 2007: Message edited by: Joe Ess ]
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by vinod perla:
I've to upload a file of size 8GB to a FTP server through a Java Application. Can anyone suggest any API/Any other way to handle it?


When we talk of bytestreams , then size really doesnot matter as streams are like byte pipes.You program might be failing because of lack of disk space at the other end.
 
vinod perla
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Joe Ess: Have you tried to upload an 8GB file? If so, what errors did you see? What OS/file system is the destination system?


I've used Jakarta Commons Net 1.4.0 API and I tried uploading a file of size 8GB to a FTP server, after transferring 2.14GB I'm getting a CopyStreamException.

I tried uploading manually the same file through FTP PUT command it uploaded successfully.
 
vinod perla
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rahul Bhattacharjee:
When we talk of byte streams , then size really doesn't matter as streams are like byte pipes. You program might be failing because of lack of disk space at the other end.


There is enough disk space at FTP Server. When I tried uploading the same file through FTP PUT command it uploaded successfully.
 
Joe Ess
Bartender
Posts: 9318
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by vinod perla:


I've used Jakarta Commons Net 1.4.0 API and I tried uploading a file of size 8GB to a FTP server, after transferring 2.14GB I'm getting a CopyStreamException.

I tried uploading manually the same file through FTP PUT command it uploaded successfully.


CopyStreamException has a method, getIOException, which is documented as:
Returns the IOException responsible for the failure of a copy operation.

I think that would give valuable insight as to what is going on here.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic