Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload a file #35

Open
mady143 opened this issue Mar 20, 2020 · 12 comments
Open

Upload a file #35

mady143 opened this issue Mar 20, 2020 · 12 comments

Comments

@mady143
Copy link

mady143 commented Mar 20, 2020

Hi @OmkarPathak ,
I am using flask framework i am trying to upload file and extract the info from that file but i am facing an issue related to that i.e, i was only able to upload the files which are present in the same folder i.e, where app.py is located when ever i was trying to upload from different location it was not uploading it was showing an error
can you help me to resolve this issue...
Thanks and Regards,
Manikantha Sekhar..

@OmkarPathak
Copy link
Owner

I didn't exactly get the issue. Can you please elaborate?

@mady143
Copy link
Author

mady143 commented Mar 20, 2020

@OmkarPathak ,
yeah sure,
actually I was uploading the file from the flask frame work
this is app.py

app = Flask(__name__)
@app.route('/')
def home():
    return render_template('index.html')

@app.route('/dict_output',methods = ['POST'])
def render():
	if request.method == "POST":
		file = request.form.get('file')
		print("File:",file)
		file_ext = file.split(".")[-1]
		dic = {}
		if file_ext == '.pdf':
			data = ResumeParser(file).get_extracted_data()
			
		else:
			data = ResumeParser(file).get_extracted_data()
		return data

if __name__ == '__main__':
    app.run()

** here while uploading the file from anywhere from my system it's getting an error like no such a file/directory like
** and while uploading the file from the current folder where app.py and index.html placed its accepting...

Thanks and Regards,
Manikantha Sekhar...

@OmkarPathak
Copy link
Owner

@mady143 can you also please provide your HTML where your form component is used

@mady143
Copy link
Author

mady143 commented Mar 23, 2020

@OmkarPathak ,
bellow you can find app.py and html code screen shots
app.py
app py screen shot

html.py
html screen shot

Thanks and Regards,
Manikantha Sekhar...

@OmkarPathak
Copy link
Owner

@mady143 you can refer this for the same

@mady143
Copy link
Author

mady143 commented Apr 15, 2020

Hi @OmkarPathak ,
I am using ResumeParser library to extract the information from the resume some of the resumes i am getting the total experience and experience and skills ,

now i am getting the exact total experience as bellow

total_exp
its is fine enough

and also getting the experience as bellow
exp
in this experience i want to extract the information clearly with number as a experience not from- present and from-to - from-to like how can i do it

and getting the skills
skills
how to remove the unnecessary elements in the skills only i want display the particular skills and aspects i want to display

can we do it and it is possible after the extract the information can you explain me how to achieve my result.
Thanks and Regards,
Manikantha Sekhar..

@mady143
Copy link
Author

mady143 commented Apr 15, 2020

Hi @OmkarPathak ,
my question is i am using flask framework and and working on the same task i.e., resume filtering actually i wrote an API that expalin how the resume and job description dynamically from the front end like

ssss

like the above image i am trying to upload the files and get the outputs
now while i was trying to upload the file from the system only where my .py is located from their its self only it was uploading means i am getting an error while uploading from the different location, getting an error like

ddddd

and my code looks like
.py and html bellow please open and look once you may understand

1

2

3

5

these are 4 screen shots i have sent all the files expect the output html file

please let me know if your confused and please help me to resolve this issue.

Thanks and Regards,
Manikantha Sekhar.

@OmkarPathak
Copy link
Owner

@mady143 for solving the file path issue, you are only extracting file.filename which gives you ONLY the file name WITHOUT the path.

First, try to open your pdf file directly. So just replace your code:

pdfFileObj = open(filename, 'rb')

with:

pdfFileObj = open(resume_file, 'rb')

If above doesn't work, try this instead.
For getting the absolute path, you can use following code before opening the file:

import os
filename = 'abc.pdf'
os.path.abspath(filename)

If you are using Python3 you can better use:

from pathlib import Path
p = Path(filename).resolve()

@mady143
Copy link
Author

mady143 commented Apr 15, 2020

Thank you @OmkarPathak for your response let me check and i will let you know if any error

Thanks and Regards,
Manikantha Sekhar..

@mady143
Copy link
Author

mady143 commented Apr 15, 2020

Hi @OmkarPathak ,

while writing
pdfFileObj = open(resume_file, 'rb') this line getting an error

TypeError: stat: path should be string, bytes, os.PathLike or integer, not FileStorage

how to rectify it can you explain

Thanks and Regards,
Manikantha Sekhar..

@OmkarPathak
Copy link
Owner

Hi @OmkarPathak ,

while writing
pdfFileObj = open(resume_file, 'rb') this line getting an error

TypeError: stat: path should be string, bytes, os.PathLike or integer, not FileStorage

how to rectify it can you explain

Thanks and Regards,
Manikantha Sekhar..

This article might help you: https://viveksb007.github.io/2018/04/uploading-processing-downloading-files-in-flask

@mady143
Copy link
Author

mady143 commented Apr 15, 2020

Hi @OmkarPathak ,
I am using ResumeParser library to extract the information from the resume some of the resumes i am getting the total experience and experience and skills ,

now i am getting the exact total experience as bellow

total_exp
its is fine enough

and also getting the experience as bellow
exp
in this experience i want to extract the information clearly with number as a experience not from- present and from-to - from-to like how can i do it

and getting the skills
skills
how to remove the unnecessary elements in the skills only i want display the particular skills and aspects i want to display

can we do it and it is possible after the extract the information can you explain me how to achieve my result.
Thanks and Regards,
Manikantha Sekhar..

can you explain/or any solution for this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants