Forums

Opening a Converted Word Document in PythonAnywhere Not Working

The pdf to word conversion app is working in my local machine. However, the converted word document cannot be opened after download. It's writing to a download folder in PythonAnywhere. Please let me know if this is a writing to PythonAnywhere issue because the converted word document is not working in the PythonAnywhere download folder too. Please help.

We need more details to help you -- could you describe how it is not working? Do you see any errors when you run your code?

I have flask app where all other parts of the app is working fine. PDF to Word conversion component of the app is not working which is supposed to work this way. After the pdf file is submitted for processing to convert to word, it should be available for downloading but the word file cannot be opened in pythonanywhere, although the file conversion works and can be opened in my local drive. The issue is specific to pythonanywhere server. The word file can not be opened in the download folder also I created in pythonanywhere server. When I try open the converted word file, "word found unreadable content" pops up. There is no error in the log. Please help

So the PDF file is being converted by the output format of the converted file is incorrect? Could you try running the same code that converts from PDF to Word in a console and see if it shows any errors?

It works in Anaconda Prompt. The pdf file is converted to word which can be opened and the content of the file is intact. The issue is specific to pythonanywhere server. It is converted to word format in terms of extension .docx, but when I try to open the file "word found unreadable content" pops up. To resolve the issue, I added code to create download folder in pythonanywhere and save the word document in that folder after conversion. Same issue when I try to open the word file there, word found unreadable content error. Please help.

Check the actual content of the converted file to see what is in it. Perhaps it's a server error that is being saved to your download folder or something like that.

Yes, I checked it. I cannot add the screenshots of the errors I get when I try to open both in download folder and when I try to open the .docx in the browser also in this forum. I am going to send you an email to support with the screenshots of the errors. I need to resolve this urgently.

I see you sent us an email about this and will reply to that.