Hi All
I am building an app that would allow users to do some NLP analysis on a text coming from multiple files.
My understanding is that python script called within flask would not have the visibility of the files saved on my local machine only the files saved on the server on my account (static folder , virutal environment etc)
To by-pass this problem I have used an HTML file-input and Javascript FileReader objects which allowed me to load multiple files, extract their text content and output it in a textarea field - from where I am able to pass the text over to python for the further analysis.
I managed to get this working for TXT and DOCX files but it cost me a lot of time trying to figure out solution in a language I am completely unfamiliar with (Javascript). I still need to add some functionality to support extraction of text from PDF files but before drifting any further from the main focus of this project (NLP) I wanted to ask if there is any elegant way of passing the content of local files to the scripts in the virtual environment?
E.g.
The HTML object File-Input allows me to select multiple PDF files - is there anyway I can pass these files over so instead of Javascript I could use python libraries to extract the text from these PDF files?
<input type="file" id="filesx" name="filesx[]" onchange="readmultifiles(this.files)" multiple="" accept=".txt,.docx,.pdf"/>