Example #1
0
def api_upload():
    # print request.files.getlist("file")
    loader = Upload(config)
    res = loader.upload_files(request) 
    json_results=[]
    if res == False:
        return jsonify(error=loader.msg)
    else:
        # get the file locations and send them back
        return jsonify(items=res.payload)
Example #2
0
def api_list():
    # print request.files.getlist("file")
    loader = List(config)
    res = loader.list_files(api.config['STAGING_FOLDER'])
    json_results=[]
    if res == False:
        return jsonify(error=loader.msg)
    else:
        # get the file locations and send them back
        return jsonify(items=res.payload)