Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Storing Paths of PDF Files into MySQL

Status
Not open for further replies.

corexdev

Programmer
May 11, 2015
7
US
Hi all ,

what im looking to do is to store the Filename.Ext "Filename only & ext " not actual File itself , and store the path of an uploaded PDF File into MySQL database, then once Displayed the user can select the PDF and it opens from the Folder on the server going by the Filename.ext and path stored in MySQL

any good examples of this or snippets would be Awesome.

thanks so much


 
What part do you have already?
[ul]
[li]user authentication?[/li]
[li]file upload function?[/li]
[li]database inserts?[/li]
[/ul]

If you are starting from scratch, I recommend a ready-made content management system (Drupal/WordPress/Joomla) or a document management system (OwnCloud). It solves all the problems for you and has the security issues of file upload and user authentication worked out.
 
no CMS is actually to much work to make it do what i want to do ,
 
A CMS with file upload and retrieval can be set up in a half hour. Developing a custom solution for your still undefined current infrastructure could take days or weeks. What exactly do you need? What do you have done already?
 
Inserting text into a Db is fairly simple i.e you insert like you insert anything else into the Db.

INSERT INTO table name values ("filename.ext","folder/folder/path");

Retrieving from the Db is equally simple, then all you would need to do is build the link from the query results.

Code:
echo "<a href='" . $mysqlresults['path'] . #mysqlresults['filename'] . ">" . $mysqlresults['filename'] . "</a>";

Where exactly are you getting hung up?






----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top