I am trying to send a static file through flask based on the user call by using the send_file method. The method keeps giving me a 200 message, but on the js file, keeps coming up as an error despite the 200. Here is the python code and the error message:
@custom_code.route('/get_data', methods=['POST'])
def get_mnist_data():
index = int(request.form['index'])
return send_file('static/stims/'+index, attachment_filename='image.png')
error message can't be copied and pasted, but it says: readyState:4, responseText: and a bunch of symbols that look like \u0000 status:200 statusText:OK
Thank you for the other response, but the difference between that and mine is that I am trying to make an ajax call to get an image from a static location and then have it displayed on the given image slot on the html file, similar to a photo album on facebook or flickr, rather than downloading the file. Would really appreciate any advice. Thanks