Large file uploads  with jersey client

Hello All,
I am getting heap spcace iissue while uploading large files via jersey client , the jvm will run out memory
Can any one help me in understanding how can i send large file about 300mb
via jersy client.
code that i have wriiten is:
WebResource webResource = client.resource(url);
MultiPart multiPart = new MultiPart();
FileDataBodyPart filePart = new FileDataBodyPart("file", file,
MediaType.APPLICATION_OCTET_STREAM_TYPE);
multiPart.bodyPart(filePart);
multiPart.bodyPart(new FormDataBodyPart("code", code));
ClientResponse response = webResource.type(MediaType.MULTIPART_FORM_DATA).post(ClientResponse.class,
multiPart);
Thanks

Thanks for ur reply but i have tried it by using
client.setChunkedEncodingSize(10000);
WebResource webResource = client.resource(url);
          // file to multi part Request
          MultiPart multiPart = new MultiPart();
          FileDataBodyPart filePart = new FileDataBodyPart("file", file,
                    MediaType.APPLICATION_OCTET_STREAM_TYPE);
          multiPart.bodyPart(filePart);
          multiPart.bodyPart(new FormDataBodyPart("code",code));
          ClientResponse response = null;
               response = webResource.type(MediaType.MULTIPART_FORM_DATA).post(ClientResponse.class,
                         multiPart);
Now the file are easily send in chunked but the problem is i am not able to receive value of code now..
On the other server where i am sending this file along code is:
public void upload(@RequestParam("file") MultipartFile uploadedFile,
               @RequestParam("code") String code,
               Writer responseWriter) throws IOException
}

Similar Messages

  • Large File Upload ~50mb Fails using Firefox/Safari. Upload Limit is 1gig set at Web App. IIS timeout set at 120 seconds.

    Strange issue.  User can upload the file using IE9, but cannot do the same using Safari, Chrome, or FireFox.  The library resides in a Site Collection that was migrated from a 2010 Site Collection.  The timeout on IIS is 120 seconds.Very strange
    indeed.
    Haven't been able to trace the Correlation ID at this point.

    try using rest api for this much file upload if you are using custom solution.
    try below links for reference:
    http://blogs.technet.com/b/praveenh/archive/2012/11/16/issues-with-uploading-large-documents-on-document-library-wss-3-0-amp-moss-2007.aspx
    https://angler.wordpress.com/2012/03/21/increase-the-sharepoint-2010-upload-file-size-limit/
    http://social.technet.microsoft.com/wiki/contents/articles/20299.sharepoint-2010-uploading-large-files-to-sharepoint.aspx
    http://stackoverflow.com/questions/21873475/sharepoint-2013-large-file-upload-1gb
    https://answers.uchicago.edu/page.php?id=24860
    http://sharepoint.stackexchange.com/questions/91767/multiple-file-upload-not-working
    Please mark it as answer if you find it useful happy sharepointing

  • Can anyone recommend a free file uploader with progress bar?

    Can anyone recommend a free file uploader with progress bar?
    I have searched google but with no luck.
    Ideally it would be a DW extension but that might be wishing
    for too much.
    I would like a large file limit for video and multiple file
    extensions allowed.
    Thanks in advance

    Heya,
    Check out this due Waleed he has some nice tuts and here's
    a
    link
    to file upload with progress bar tutorial he has. Granted it
    looks like it's just an animated gif letting users know their file
    is uploading; if you want realtime upload information displayed for
    the user you're gonna have to look at something like Flash with the
    power of actionscript to achieve that result.
    Hope that helps!

  • File upload with 'asp vb' backend

    Hello,
    I am trying to get file uploading with flex (flash buider) working. There are plenty of examples with a php backend, but i need the script for a 'asp vb' backend.
    I' ve tried lots of different approaches but can't get it right. Someone out there with a solution?
    Thanx!!

    Believe it or not I have to do this also.
    I have legacy ASP code that uses ASPUpload that I'd like to get working with my Flash CS5 and FlashBuilder Burrito front-ends.
    it's just multipart encoded.
    So, if you first test it with ASPUpload and a simple form, trying just FILE1 first, and it works with ASP backend then tackle the FlashBuilder side with some debugging.
    ASPUpload is still an extremely embedded component on tens of thousands if not more sites, and it was just updated, but I think the previous version just before this update, the one that's out there in code on so many sites, that is what Flash needs to work with.
    ASPUpload is doing its part, as it follows all the multipart encoded RFC rules and has worked for years.
    I'd love to join you in finding out what's going on here.
    This is a long-standing issue.
    I've done PHP also.  But again, enhancing an interface with FlashBuilder4 or Burrito, to integrate with working legacy code makes it hard when something is not working on the Flash side (it appears anyway) as ASPUpload form posts are extremely easy.

  • Multiple File Upload With Metadata Using REST

    hi all
    I want to upload multiple files with metadata to document library using REST API. I am using this msdn article
    http://msdn.microsoft.com/en-us/library/office/dn769086(v=office.15).aspx for uploading file. I am able to upload single file to document library but it is not working for multiple file. when I select multiple file it is uploading last selected file. can
    anyone help with this. I am using office 365 environment.
    Thanks in advance

    Hi,
    According to your post, my understanding is that you wanted to use the REST to upload multiple files.
    Per my knowledge, the REST API is not supported for uploading multiple files via a single call.
    You can write your own loop to upload multiple files via an individual call.
    http://sharepoint.stackexchange.com/questions/108525/multiple-file-upload-with-metadata-using-rest/108532#108532
    More reference:
    http://sharepointfieldnotes.blogspot.com/2014/04/uploading-documents-and-setting.html
    http://www.shillier.com/archive/2013/03/26/uploading-files-in-sharepoint-2013-using-csom-and-rest.aspx
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Large file folder with question mark is flashing on screen.

    Just turned on computer for the first time and a large file folder with a question mark is flashing on the screen. I am unable to do anything and have restarted and it does the same thing.  Please help!

    It does this when it can't see the operating system. You didn't give much information but I'm assuming it's a brand new mini and you aren't using any external drives for the operating system. If that's the case then yes, reinstall OS X. Put your install DVD into the optical drive and reboot. As soon as you hear the chime, hold down the "C" key on your keyboard (or the Option key until the Install Disk shows up). That will force your Mac to boot from the install DVD in the optical drive.
    If reinstallation isn't possible, or if the problem continues after reinstallation, then you need to exchange it for another, because something is keeping the operating system on the drive from being read.

  • File Uploading with two command button

    Hi all,
    After a long I return back.
    I am having a JSP page with some mandatory fields and one attach document field.
    I am using JSF framework so for file upload i used the tag <t:inputfileupload>, for compulsion fields I used the attribute required = true.
    My problem is,
    If i attach the file and click attach button before filling mandatory fields the action method is not called. Only after filling the mandatory fields the action method is called. What may be the reason for this?
    Is there any example for file uploading with in form and it has two separate command buttons?

    DHURAI wrote:
    Hi all,
    After a long I return back.
    I am having a JSP page with some mandatory fields and one attach document field.
    I am using JSF framework so for file upload i used the tag <t:inputfileupload>, for compulsion fields I used the attribute required = true.
    My problem is,
    If i attach the file and click attach button before filling mandatory fields the action method is not called. Only after filling the mandatory fields the action method is called. What may be the reason for this?My guess: you get validation errors, but you don't have a <h:messages/> in your JSF page so you don't see the error yourself. If you check your log files it will most likely be mentioned there.

  • Very large file upload 2 GB with Adobe Flash

    Hello, anyone know how can I upload very large files with Adobe Flash or how to use SWFUpload?
    Thanks in Advance, All help will be very appreciated.

    1. yes
    2. I'm getting error message from php
    if( $_FILES['Filedata']['error'] == 0 ){ 
      if(move_uploaded_file( $_FILES['Filedata']['tmp_name'], $uploads_dir.$_FILES['Filedata']['name'] ) ){ 
      echo 'ok'; 
      exit(); 
      echo 'error';    // Overhere
      exit();

  • Can't Upload Large Files (Upload Fails using Internet Explorer but works with Google Chrome)

    I've been experience an issue uploading large (75MB & greater) PDF files to a SharePoint 2010 document library. Using normal upload procedures using Internet Explorer 7 (our company standard for the time being) the upload fails. No error message is thrown,
    the upload screen goes away and the page refreshes and the document isn't there. I tried upload multiple and it says throws a failed error after a while.
    Using google chrome I made an attempt just to see what it did and the file using the "Add a document" uploaded in seconds. Can't figure out why one browser worked and the other doesn't. We are getting sporadic inquiries with the same issue.
    We have previously setup large file support in the appropriate areas and large files are uploaded to the sites successfully. Any thoughts?

    File size upload has to be configured on the server farm level. Your administrator most likely set
    up the limit to size of files that can be uploaded. This size can be increased and you would then be able to upload your documents.

  • 16.0.2 crashes with large file uploads

    Hi, I have noticed that Firefox 16.0.2 crashes when I try uploading a large file (1.2GB) to a website.
    The entire browser closes and I get a window offering to submit a report for me. Can anybody tell me what I need to change to stop this from happening please?
    Thanks,
    Paul

    Be sure to rollback to 16.0.1; the initial v16 update had serious security flaw.

  • Axis large file uploads

    Hi,
    I am running axis1.3 on websphere Z/OS and i am uploading large files. I a getting the following error when
    error1:
    1)i try to upload the files of size 30mb. Initially i tried to upload 30mb it got success
    2) tried to upload again 30mb but this time the error occurs as below
    Exception in thread "main" AxisFault
    faultCode: {http://xml.apache.org/axis/}HTTP
    faultSubcode:
    faultString: (0)null
    faultActor:
    faultNode:
    faultDetail:
    {}:return code: 0
    {http://xml.apache.org/axis/}HttpErrorCode:0
    (0)null
    at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.j
    ava:744)
    at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
    at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrateg
    y.java:32)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
    at org.apache.axis.SimpleChain.invoke (SimpleChain.java:83)
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    at org.apache.axis.client.Call.invoke(Call.java :2767)
    at org.apache.axis.client.Call.invoke(Call.java:2443)
    at org.apache.axis.client.Call.invoke(Call.java:2366)
    at org.apache.axis.client.Call.invoke(Call.java:1812)
    at gov.ssa.ere.client.EREWSSOAPStub.submitBulk (Unknown Source)
    at gov.ssa.ere.client.StubClient.main(Unknown Source)
    the same error occurs when i tried to upload more than 30mb ....
    error2:
    sometimes my request got into the server and the server even process my requests in the mean time my client got the error as below (i have used the client timeout also as 100000)
    Exception in thread "main" AxisFault
    faultCode: {http://xml.apache.org/axis/}HTTP
    faultSubcode:
    faultString: (0)null
    faultActor:
    faultNode:
    faultDetail:
    {}:return code: 0
    {http://xml.apache.org/axis/}HttpErrorCode:0
    (0)null
    at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.j
    ava:744)
    at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
    at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrateg
    y.java:32)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
    at org.apache.axis.SimpleChain.invoke (SimpleChain.java:83)
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    at org.apache.axis.client.Call.invoke(Call.java :2767)
    at org.apache.axis.client.Call.invoke(Call.java:2443)
    at org.apache.axis.client.Call.invoke(Call.java:2366)
    at org.apache.axis.client.Call.invoke(Call.java:1812)
    at gov.ssa.ere.client.EREWSSOAPStub.submitBulk (Unknown Source)
    at gov.ssa.ere.client.StubClient.main(Unknown Source)

    I would imagine that this has to do with you reading the entire file into memory to send it via HTTP.  This would be a limitation of the WebKit implentation that currently exists.  I don't know if it has been fixed in the latest AIR 2.0 beta that just got pushed out onto Labs.
    Ultimatly, you may want to take one of these OSS projects you found (the as3httpclientlib looks most promising), and compile a very small flash app that co-exists in your JS AIR app.  You would be able to call it directly from JS, and use the functions that you expose just like the rest of the API's that exist in the AIR framework.

  • Tips or tools for handling very large file uploads and downloads?

    I am working on a site that has a document repository feature. The documents are stored as BLOBs in an Oracle database and for reasonably sized files its not problem to stream the files out directly from the database. For file uploads, I am using the Struts module to get them on disk and am then putting the blob in the database.
    We are now being asked to support very large files of 250MB+. I am concerned about problems I've heard of with HTTP not being reliable for files over 256MB. I'd also like a solution that would give the user a status bar and allow for restarts of broken uploads or downloads.
    Does anyone know of an off-the-shelf module that might help in this regard? I suspect an ActiveX control or Applet on the client side would be necessary. Freeware or Commercial software would be ok.
    Thanks in advance for any help/ideas.

    Hi. There is nothing wrong with HTTP handling 250MB+ files (per se).
    However, connections can get reset.
    Consider offering the files via FTP. Most FTP clients are good about resuming transfers.
    Or if you want to keep using HTTP, try supporting chunked encoding. Then a user can use something like 'GetRight' to auto resume HTTP downloads.
    Hope that helps,
    Peter
    http://rimuhosting.com - JBoss EJB/JSP hosting specialists

  • Large file upload

    Hi all,
    Is there a way to upload a large file.
    The problem:
    1 file with fixed length records (59 bytes wide)
    Over 17million lines available (actually a download from an extreme old system), making a total of almost 1Gb.
    I have a database table that exactly machtes the record data.
    So the question is: How to upload this amount of data. The normal upload functions do not apply because i run out of memory space (system I-MODE too large).
    Regards,
    Rob.

    Hi Rob,
    I'm not too sure if this solution will be acceptable in your case, but here's one way that I can think of -
    You can FTP this file to the Application Server and then process this file through a simple ABAP program and update the file's data to the desired database table.
    Regards,
    Anand Mandalika.

  • Large file transfer problems over client/server socket

    Hi,
    I wrote a simple chat problem in which I can send files from client to client. The problem is when I send large files over 101 MB the transfer freezes. I do not even get any error mesages in the console. The files I am sending are of any type (Ex mp3, movies, etc...). I am serializing the data into a "byteArray[packetSize]" and sending the file packet by packet until the whole file has been sent, and reconstructed on the other side. The process works perfectly for files smaller than 101MB, but for some reason freezes after that if the file is larger. I have read many forums and there aren't too many solutions out there. I made sure to use the .reset() method to reset my ObjectOutputStream each time I write to it.
    Here's my file sending code:
    byte[] byteArray = new byte[defaultPacketSize];
    numPacketsRequired = Math.ceil(fileSize / defaultPacketSize);
    try {
    int i = 0;
    reader = new FileInputStream(filePath);
    while (reader.available() > 0) {
    if (reader.available() < defaultPacketSize) {
    byte[] lastPacket = new byte[reader.available()];
    reader.read(lastPacket);
    try {
    if (socket == null || output == null) {
    throw new SocketException("socket does not exist");
    output.writeObject(lastPacket);
    output.reset();
    output.writeObject("DONE");
    output.reset();
    output.close();
    socket.close();
    catch (Exception e) {
    System.out.println("Exception ***: " + e);
    output.close();
    socket.close();
    else {
    reader.read(byteArray);
    try {
    if (socket == null || output == null) {
    throw new SocketException("socket does not exist");
    output.writeObject(byteArray);
    output.reset();
    catch (Exception e) {
    System.out.println("Exception ***: " + e);
    output.close();
    socket.close();
    reader.close();
    catch (Exception e) {
    System.out.println("COULD NOT READ PACKET");
    Here's my file receiving code:
    try {
    // The message from the client
    Object streamInput;
    FileOutputStream writer;
    byte[] packet;
    while (true) {
    streamInput = input.readObject();
    if (streamInput instanceof byte[]) {
    packet = (byte[]) streamInput;
    try {
    writer = new FileOutputStream(outputPath, true);
    writer.write(packet); //Storing the bytes on file
    writer.close();
    catch (Exception e) {
    System.out.println("Exception: " + e);
    else if (streamInput.equals("DONE")) {
    socket.close();
    input.close();
    break;
    catch (Exception e) {
    I'm looking for any way I can possibly send large files from client to client without having it freeze. Are there any better file transfer ways other than socket? I don't really want FTP. I think I want to keep it HTTP.
    Any suggestions would be helpful.Thanks!
    Evan

    I've taken a better look a the code you posted, and
    there is one problem with the receiving code. You
    keep repeatedly opening and closing the
    FileOutputStream. This is not going to be efficient
    as the file will keep needing to be positioned to its
    end.Yes sorry I did change that code so that it leaves the file open until completely done writing. Basically I have a progress bar that records how far along in the writing process the client is, and when the progress bar reaches 100%, meaning the file is complete, the file.close() method is invoked. Sorry about that.
    I also ran some memory tests using the "Runtime.getRuntime().totalMemory()", and "Runtime.getRuntime().freeMemory()" methods. I put these methods inside the loop where I read in the file and send it to the client. here's the output:
    Sender's free memory: 704672
    File reader read 51200 bytes of data.
    767548 left to read.
    Sender's runtime memory: 2818048
    Sender's free memory: 702968
    File reader read 51200 bytes of data.
    716348 left to read.
    Sender's runtime memory: 2818048
    Sender's free memory: 701264
    File reader read 51200 bytes of data.
    665148 left to read.
    Sender's runtime memory: 2818048
    Sender's free memory: 699560
    File reader read 51200 bytes of data.
    613948 left to read.
    Sender's runtime memory: 2818048
    Sender's free memory: 697856
    File reader read 51200 bytes of data.
    562748 left to read.
    Sender's runtime memory: 2818048
    Sender's free memory: 696152
    File reader read 51200 bytes of data.
    511548 left to read.
    Sender's runtime memory: 2818048
    Sender's free memory: 694448
    File reader read 51200 bytes of data.
    460348 left to read.
    Sender's runtime memory: 2818048
    Sender's free memory: 692744
    File reader read 51200 bytes of data.
    409148 left to read.
    Sender's runtime memory: 2818048
    Sender's free memory: 691040
    File reader read 51200 bytes of data.
    357948 left to read.
    Sender's runtime memory: 2818048
    Sender's free memory: 689336
    File reader read 51200 bytes of data.
    306748 left to read.
    Sender's runtime memory: 2818048
    Sender's free memory: 687632
    File reader read 51200 bytes of data.
    255548 left to read.
    Sender's runtime memory: 2818048
    Sender's free memory: 685928
    File reader read 51200 bytes of data.
    204348 left to read.
    Sender's runtime memory: 2818048
    Sender's free memory: 684224
    File reader read 51200 bytes of data.
    153148 left to read.
    Sender's runtime memory: 2818048
    Sender's free memory: 682520
    File reader read 51200 bytes of data.
    101948 left to read.
    Sender's runtime memory: 2818048
    Sender's free memory: 680816
    File reader read 51200 bytes of data.
    50748 left to read.
    Sender's runtime memory: 2818048
    Sender's free memory: 679112
    File reader read 50748 bytes of data.
    0 left to read.
    Creating last packet of size: 50748
    Last packet size after setting it equal to byteArray: 50748
    Here's the memory stats from the receiver:
    Receiver's free memory: 639856
    Receiver's total memory: 2842624
    Receiver's free memory: 638920
    Receiver's total memory: 2842624
    Receiver's free memory: 637984
    Receiver's total memory: 2842624
    Receiver's free memory: 637048
    Receiver's total memory: 2842624
    Receiver's free memory: 636112
    Receiver's total memory: 2842624
    Receiver's free memory: 635176
    Receiver's total memory: 2842624
    Receiver's free memory: 634240
    Receiver's total memory: 2842624
    Receiver's free memory: 633304
    Receiver's total memory: 2842624
    Receiver's free memory: 632368
    Receiver's total memory: 2842624
    Receiver's free memory: 631432
    Receiver's total memory: 2842624
    Receiver's free memory: 630496
    Receiver's total memory: 2842624
    Receiver's free memory: 629560
    Receiver's total memory: 2842624
    Receiver's free memory: 628624
    Receiver's total memory: 2842624
    Receiver's free memory: 627688
    Receiver's total memory: 2842624
    Receiver's free memory: 626752
    Receiver's total memory: 2842624
    Receiver's free memory: 625816
    Receiver's total memory: 2842624
    Receiver's free memory: 624880
    Receiver's total memory: 2842624
    Receiver's free memory: 623944
    Receiver's total memory: 2842624
    Receiver's free memory: 623008
    Receiver's total memory: 2842624
    Receiver's free memory: 622072
    Receiver's total memory: 2842624
    Receiver's free memory: 621136
    Receiver's total memory: 2842624
    Receiver's free memory: 620200
    Receiver's total memory: 2842624
    Receiver's free memory: 619264
    Receiver's total memory: 2842624
    Receiver's free memory: 618328
    Receiver's total memory: 2842624
    Receiver's free memory: 617392
    Receiver's total memory: 2842624
    Receiver's free memory: 616456
    Receiver's total memory: 2842624
    Receiver's free memory: 615520
    Receiver's total memory: 2842624
    Receiver's free memory: 614584
    this is just a sample of both receiver and sender's stats. Everything appears to be fine! Hope this message post isn't too long.
    Thanks!

  • IPlanet 6.0 SP4 crashes for large file uploads

    Environment:
    iPlanet 6.0 SP4,iPlanet App Server 6.5, with maintenance update 3 installed running on the same machine on Solaris 8.0 (Sparc)
    When I try to upload large file( > 10 MB) using HTTP POST MULTIPART/FORM-DATA the web server crashes with the following errors.
    [18/Oct/2002:16:52:02] catastrophe ( 600): Server crash detected (signal SIGSEGV) [18/Oct/2002:16:52:02] info ( 600): Crash occurred in function memmove from module /export/home/iplanet/web60sp4/bin/https/lib/liblibdbm.so [18/Oct/2002:16:52:02] failure ( 376): Child process admin thread is shutting down [18/Oct/2002:16:52:05] warning ( 624): On group ls2_default, servername oberon does not match subject "192.168.0.35" of certificate Server-Cert. [18/Oct/2002:16:52:05] info ( 624): Installing a new configuration [18/Oct/2002:16:52:05] info ( 624): [LS ls1] http://oberon, port 80 ready to accept requests [18/Oct/2002:16:52:05] info ( 624): [LS ls2] https://oberon, port 443 ready to accept requests [18/Oct/2002:16:52:05] info ( 624): A new configuration was successfully installed [18/Oct/2002:16:52:05] info ( 624): log.cpp:openPluginLog() reports: Environment variable IAS_PLUGIN_LOG_FILE is not set. All plugin messages will be logged in the web server log file
    [21/Oct/2002:10:40:02] catastrophe ( 1210): Server crash detected (signal SIGSEGV) [21/Oct/2002:10:40:02] info ( 1210): Crash occurred in NSAPI SAF gxrequest [21/Oct/2002:10:40:02] info ( 1210): Crash occurred in function __1cIGXBufferLAllocMemMap6ML_L_ from module /export/home/iplanet/app65mu3/ias/gxlib/libgxnsapi6.so [21/Oct/2002:10:40:02] failure ( 715): Child process admin thread is shutting down [21/Oct/2002:10:40:05] warning ( 1230): On group ls2_default, servername oberon does not match subject "192.168.0.35" of certificate Server-Cert. [21/Oct/2002:10:40:05] info ( 1230): Installing a new configuration [21/Oct/2002:10:40:05] info ( 1230): [LS ls1] http://oberon, port 80 ready to accept requests [21/Oct/2002:10:40:05] info ( 1230): [LS ls2] https://oberon, port 443 ready to accept requests [21/Oct/2002:10:40:05] info ( 1230): A new configuration was successfully installed
    Do I need to set anything in the web server or app server? Any help is appreciated.

    Be sure to rollback to 16.0.1; the initial v16 update had serious security flaw.

Maybe you are looking for