Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 7 of 7

Thread: Want to upload csv file of greter than 200 Mb

  1. #1
    Junior Member
    Join Date
    Feb 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Want to upload csv file of greter than 200 Mb

    hi

    i tried to upload the file bt i cant
    i want to upload file which size is greater than 200 Mb and also it should be csv file.


    please guide me


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,264
    Thanks
    176
    Thanked 821 Times in 764 Posts
    Blog Entries
    5

    Default Re: Want to upload csv file of greter than 200 Mb

    i tried to upload the file bt i cant
    Why? Did you get exceptions? If so what are they? If not, we have no clue about your project and as a result can't provide much help without

  3. #3
    Junior Member
    Join Date
    Feb 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Want to upload csv file of greter than 200 Mb

    it gives me exception like outofmemory:Java heap space

  4. #4
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,264
    Thanks
    176
    Thanked 821 Times in 764 Posts
    Blog Entries
    5

    Default Re: Want to upload csv file of greter than 200 Mb

    How are you uploading? Post code...without knowing the workings of the process....well, its called guessing.

  5. #5
    Member
    Join Date
    Jul 2010
    Location
    Washington, USA
    Posts
    307
    Thanks
    16
    Thanked 43 Times in 39 Posts

    Default Re: Want to upload csv file of greter than 200 Mb

    If you're loading the whole file into the program you have to increase the heap past the default size. Try running your program in Terminal as so; java -Xmx500M nameOfClass.java

    If it's a jar: java -Xmx500M -jar nameOfJar.jar

  6. #6
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,264
    Thanks
    176
    Thanked 821 Times in 764 Posts
    Blog Entries
    5

    Default Re: Want to upload csv file of greter than 200 Mb

    If you're loading the whole file into the program you have to increase the heap past the default size.
    I agree...but presuming its a servlet (in the servlets section) that is throwing the exception,its a bit more complex than increasing the memory (again, the original poster needs to provide more information for us to know for sure). If your saving the file somewhere, try doing so through a stream rather than reading it into memory the saving the contents.

  7. #7
    Member
    Join Date
    Jul 2010
    Location
    Washington, USA
    Posts
    307
    Thanks
    16
    Thanked 43 Times in 39 Posts

    Default Re: Want to upload csv file of greter than 200 Mb

    Quote Originally Posted by copeg View Post
    I agree...but presuming its a servlet (in the servlets section) that is throwing the exception,its a bit more complex than increasing the memory (again, the original poster needs to provide more information for us to know for sure). If your saving the file somewhere, try doing so through a stream rather than reading it into memory the saving the contents.
    Haha my bad. I've never used JavaEE so good luck.

Similar Threads

  1. how to upload netbeans's code in cpanel
    By sabina in forum Java Networking
    Replies: 3
    Last Post: February 8th, 2011, 07:28 AM
  2. Upload Image / Document
    By systech44 in forum Java Servlet
    Replies: 1
    Last Post: August 11th, 2010, 09:42 AM
  3. java.net.HttpURLConnection:large file to upload
    By tommy_725 in forum Java Networking
    Replies: 1
    Last Post: October 28th, 2009, 11:53 AM
  4. How to upload a file by clicking a link instead of button?
    By raghuprasad in forum Java Theory & Questions
    Replies: 2
    Last Post: May 3rd, 2009, 05:21 AM