Displaying text files in website - database

I am developing a website for my dept. My website lists out all project papers in our college. All project papers are .txt files or pdf files or word files.
What is the best way of displaying?
Is using CMS, the efficient way to display the text content?
Uploading the text in DB is a big process. Need to take care of each line.
Is any other way of displaying it?
I dont want to change the format of txt files. It should be displayed as it is in files. Please suggest me.

If it was just text files you could use a CMS as they can keep the text layout, but with Word and PDF files you could just treat it as files.
To start simply, upload the files and have an index page which links to the all the files. To display text and PDF files it should show ok in the browser, but the Word documents would probably be downloaded and viewed on the clients PC (though there are probably plugins if you search)

Related

Can't use PNG files larger than 10kb in pdf generation

I am trying to generate pdf files using renderToStaticMarkup from react-dom/server library and every time I am using png files larger than 10KB it doesn't display them. I read the documentation for any workarounds, but found nothing. It does not allow for other file types like .svg either. Is there any way for me to add good quality images to pdfs or I have to go by without them? Thanks for all the answers in advance!
PS. When I load images from external links they display properly.

Data Extraction from PDF

I get 15+ PDF's a day that I have to enter into a database. They are generated from a table where the "Blanks" are filled in from specific table fields. Any tools or python code examples I could use to try and develop a means of extracting the data from the PDF to either write to or create a table to import to the database table? The Database is currently Access mdb.
Thanks
There are a number of approaches that will work.
One simple approach is to simply print the PDF file out to a text file and then have Access import that text. All recent versions of windows allow you to install a “text” printer that outputs the printing of a document to a text file. You can have access “process” a folder of pdfs, print them to text and then import those text files. You might need some VBA to remove “pages” and some extra lines before you import the data into Access.
Another approach is to use Word (Automate from Access) to open a PDF. When word opens a pdf, it converts it to a word document. This approach will even format rows as a word table. You can then pluck out that table data and send that data to word. You can likely pull that text out without writing the data out to a text file – or just use Words “save-as” to a text file (you can automate this process from Access).
Another approach is to use the free Ghost Script library that can extract text from a PDF (this I would consider if did not have word at your disposal).
So which solution is best will much depend on the current software you going to have installed on the computer running Access. Opening the pdf files with word would be my first choice and test.
At my old job we used Cogniview which converted PDF to Excel spreadsheets quite quickly. If you want to use Python, a quick search yielded me this which seems straight forward enough, PDF to XLS with Python

How can I copy all of the URLs that appear in the Network tab in Firefox in the Developer Toolbar?

I have bought a template that comes with hundreds if not thousands of files (Javascript, images, plugins, etc.). I have now chosen one of the homepages (out of many) that I want to use. Rather than copying thousands of files, I'd like to JUST copy those that I am really using. So I have copied the HTML file to a new folder, and opened it in Firefox. In the Network tab of the Developer Toolbar I can easily see which files are missing (404 response). There are 60 files.
Now, in order to make my life easy I'd like to write a simply command line script that copies those files from the original template folder to my new folder. To do that, I need the URLs for each site. But it means I'd have to right click on each file and go to COPY URL. That is getting very boring. How can I somehow select them all and get all the URLs?

How to get the directory tree from the client

I'm trying to make a website where a user can choose a directory from his/her pc. Then i want to get a full directory tree from that point. So that i can process the filenames. It's not necessary to upload anything. Just the filenames are enough.
The closest thing i have seen is the upload procedure on http://www.connect.garmin.com.
When you plug in your gps and click on upload. The site gives you a full list of files that can be uploaded from your gps and whether or not you have already uploaded it.
How can this be done? PHP, javascript or a plugin in python?
it looks like there are a few people that had the same question that you did, here is a Link to a blog that I found on another Question on SO
HTML5 Upload Blog
here is the SO Question I found it on
Html 5 File upload
there is a lot of information on that blog that is very useful and I think that you will find everything that you are asking there.
Most of the File Browsing is done by the clients Web Browser so you won't have to worry about coding the actual pop up window. you just have to give the browser the type of files that you are looking for.

How to retrieve contents from a uploaded file

I am using cakephp framework. I would like to retrieve the contents of the uploaded file and store it in the database. I want to be able to search the content of the uploaded file.
I was made aware that file_get_contents would work for plain .txt files. But all my documents are .docx and .pdfs. Is there any solution I could use.
I appreciate any help.
Thanks
A quick google search got me this:
http://davidwalsh.name/read-pdf-doc-file-php
It appears you can search those files but it requires some additional packages.

Resources