File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -218,6 +218,12 @@ def fileget():
218218 """Returns the file data of the file indicated by the query parameters."""
219219 return static_file (resolve_file (), root = settings .BASE_DIR )
220220
221+ @route ('/fileupload' , method = 'OPTIONS' )
222+ def fileupload_options ():
223+ response .set_header ('Access-Control-Allow-Origin' , '*' )
224+ response .content_type = "text/plain; charset=utf-8"
225+ return ''
226+
221227@route ('/fileupload' , method = 'POST' )
222228@require_token ('store' )
223229def fileupload ():
@@ -238,6 +244,7 @@ def fileupload():
238244 upload = request .files .values ()[0 ]
239245 upload .save (pathname , overwrite = True )
240246
247+ response .set_header ('Access-Control-Allow-Origin' , '*' )
241248 response .content_type = 'text/plain; charset=utf-8'
242249 return 'Ok.'
243250
You can’t perform that action at this time.
0 commit comments