-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File uploading endpoint added #3867
Conversation
Codecov Report
@@ Coverage Diff @@
## nextgen #3867 +/- ##
==========================================
- Coverage 54.54% 54.3% -0.25%
==========================================
Files 133 133
Lines 7953 7992 +39
==========================================
+ Hits 4338 4340 +2
- Misses 3615 3652 +37
Continue to review full report at Codecov.
|
app/api/uploads.py
Outdated
from flask import Blueprint | ||
from flask import url_for, make_response, request, current_app, jsonify, abort | ||
from flask_jwt import jwt_required | ||
from flask import current_app as app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'flask.current_app as app' imported but unused
app/api/uploads.py
Outdated
@@ -0,0 +1,69 @@ | |||
from flask import Blueprint | |||
from flask import url_for, make_response, request, current_app, jsonify, abort |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'flask.url_for' imported but unused
'flask.current_app' imported but unused
|
||
+ Request(multipart/form-data; boundary=---BOUNDARY) | ||
|
||
-----BOUNDARY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add sample data too. Blueprint should have a full sample request
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@niranjan94 as far as I saw in examples of API Blueprint of files, if the data is in the form of base64encoded image or any other hash, then data is also included. Else, it is shown like this. One of the links I referred is this. See the CSV file upload in the example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm ... okay
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anything else?
app/api/uploads.py
Outdated
return jsonify({"url": image_url}) | ||
|
||
|
||
@upload_routes.route('/file', methods=['POST']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets call it files
by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I saw the issue description and did accordingly. 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved.
145a3ce
to
c61dad8
Compare
Fixes #
Checklist
development
branch.#3738