#๐Ÿ”’ the file which I am receiving from html page is not saved at the desired location

7 messages ยท Page 1 of 1 (latest)

inland oak
#

hi so I am receiving a txt file from my html page running on the flask server.

file = request.files['file']

Now my database has following structure : unique_id, name, l1, l2, l3, tag_id, here l1, l2 and l3 form the path to where I want to save the received file. the path goes like this : 'D:\l1\l2\l3'. For saving the file I am using this statement:

destination_path = os.path.join('D:\\',level1, level2, level3)
file.save(os.path.join(destination_path, file.filename))

but I am not seeing the file at that location, what can be its cause?

Full code is at:
https://github.com/Amritanshu-Shandilya/Resource_Server/blob/main/resource_server.py

GitHub

A locally hosted webserver for serving files to clients. - Amritanshu-Shandilya/Resource_Server

sage epochBOT
#

@inland oak

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

inland oak
#

i want to save the file at the destination path, and I am unable to do so

inland oak
#

hello?

inland oak
#

destination_path = os.path.join('D:\',level1, level2, level3)

sage epochBOT
#

@inland oak

Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.