0

Im using Python bottle framework to upload a file..The controller receives the file and transmits to another system using Java rest service..

Everything works fine when the file is small but if the file is huge (it takes 5 mints) the application returns a blank page instead of a html page that its supposed to return.

@app.route('/DataLoads',method='GET')
def pptriv():
    return template('dataload',
                    footer_html=FOOTER_HTML,feedback_html=FEEDBACK_HTML)


@app.route('/DataLoads',method='POST')
def pptriv():
    username = request.forms.get('username')
    password = request.forms.get('password')
    uploadfile = request.files.get('File Upload')

    ....
    ..use Python requests module to transmit the files.....
    ...
    print 'r.status_code = ', r.status_code


    return template('dataload',
                    footer_html=FOOTER_HTML,feedback_html=FEEDBACK_HTML)

I see the print stmt r.status_code but the dataload html page, if its small file everything looks good..

user1050619
  • 19,822
  • 85
  • 237
  • 413
  • Please define "huge." How big is the file that doesn't work? – ron rothman Feb 19 '15 at 15:06
  • It's a 100MB file. 80MB works without any issues. Not sure if there is any response time within the Bottle framework or Apache server. – user1050619 Feb 19 '15 at 15:07
  • Okay -- try the upload with `curl -v` and see what HTTP status code is returned. If 413, then you need to increase MEMFILE_MAX. This will also help expose whether a timeout is the problem. – ron rothman Feb 19 '15 at 15:36

1 Answers1

0

Have you tried increasing MEMFILE_MAX?

import bottle
bottle.BaseRequest.MEMFILE_MAX = 1024 * 1024 * 200

Python bottle module causes "Error: 413 Request Entity Too Large"


Also: are you using a browser or a command-line client to upload the file? If browser, then I'd suggest using curl to see exactly what (if anything) is returned from your server.

Community
  • 1
  • 1
ron rothman
  • 17,348
  • 7
  • 41
  • 43
  • Im using Python requests module to call the service that uploads the file...The file is uploaded by the webservice and the webservice return rc=200 but response page is blank.. – user1050619 Mar 12 '15 at 16:56