Views. Py
Def the download (request) :
Aa=request. GET # resource path
Bb=request. GET # resource name
File=open (' static \ \ files \ \ '+ aa + + bb' \ \ ', 'rb') # problem in the line
The response=FileResponse (file)
='application/octet - the response stream'
# response='attachment; Filename=\ '+ bb +' \ "" '
The response='attachment; Filename=\ "" + escape_uri_path (bb) + '"'
Return the response
Error: No to the file or directory: 'static \ \ files \ \ xxx1 \ \ xxx2'
Visit the
http://127.0.0.1/download/? Aa=xxx& Bb=xxx2the way, I also tried some absolute paths, not speed, the deployment should be how to operate?
CodePudding user response:
His stick and yourself,,,