Skip to content

File Upload #33

Open
Open
@vladinator1000

Description

@vladinator1000

I'm working on an example repo and was wondering, what would be the simplest way to implement that? This is what I tried without GraphQL:

@app.route('/upload', methods=['POST'])
def uploadFile():
	for key in request.files:
		file = request.files[key]
		file.save(os.path.join(UPLOAD_FOLDER, file.filename))
	
	return 'uploaded'

This is what I used in Node.js, would love to do something like that for Flask in Python.

If it's not supported by flask-graphql I'd be happy to work on a pull request. Also, how would you test this without a browser, using Graphiql, Postman or something like that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions