javaajaxapipostweblogic

Unable to Send a large CSV through AJAX POST call


Trying to perform an ajax post call for an existing software which is running on weblogic. I am trying to send a csv through a post callwhich will be hit a java api file. But due to the file being large(1.96MB approx) it is throwing 500 internal server and is not hitting the java class. Any suggestions on how to work on this issue.

I have already studied the Weblogic logs, and found the attached log

Any suggestion will be helpful!!


Solution

  • You omit the required HTML header:

    The first line of output must declare the data that follows.
    This line has to be followed by an empty line.

    As you probably want your visitor to download the file, your script should issue as the first line (followed by an empty line):

    Content-Disposition: attachment; filename=mytest.csv
    
    

    Sample script:

    #!/bin/sh
    echo 'Content-Disposition: attachment; filename="Official Filename.csv"
    '
    cat "./internal_filename.csv"