LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-23-2009, 04:11 AM   #1
superevilspacemonkey
LQ Newbie
 
Registered: Apr 2008
Location: switzerland
Distribution: OpenSuse 11.2
Posts: 6

Rep: Reputation: 0
mysql phpMyAdmin - attach files to database


Hi,

I hope you can help me, I have touched mysql & phpMyAdmin for the first time last week. I suspect the solution is very simple... alas.

I would like to create a field, "attachment", in a table, "reports", that contains a hyperlink to a file (usually .pdf, .jpg & .doc).

I have managed attaching jpg's using the type "Long BLOB" and MIME transformations, but I suspect that this method actually includes the attached jpg in the database. Ideally I would like the files (about 20GB in total and growing), to physically remain where they are; but include a "shortcut" in the database, so that I can launch/download them from phpMyAdmin. Also, if there is a solution that makes it easy'ish for non-programmers to attach files it would be great.

I should also mention, that to my shame, this is for a system running on "that other OS".. Its for work..

Please help!
 
Old 04-24-2009, 02:20 PM   #2
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
Quote:
Originally Posted by superevilspacemonkey View Post
Hi,

I hope you can help me, I have touched mysql & phpMyAdmin for the first time last week. I suspect the solution is very simple... alas.

I would like to create a field, "attachment", in a table, "reports", that contains a hyperlink to a file (usually .pdf, .jpg & .doc).

I have managed attaching jpg's using the type "Long BLOB" and MIME transformations, but I suspect that this method actually includes the attached jpg in the database. Ideally I would like the files (about 20GB in total and growing), to physically remain where they are; but include a "shortcut" in the database, so that I can launch/download them from phpMyAdmin. Also, if there is a solution that makes it easy'ish for non-programmers to attach files it would be great.

I should also mention, that to my shame, this is for a system running on "that other OS".. Its for work..

Please help!
As long as the URL can be accessed from whatever host is clicking it, it is just a text field in the database like a username or cityname or any other common field... how you deal with it in the app that's using the database is another story-- If remote people are going to access it over say the web you're going to need a webserver, if they're accessing it on a share, you'll need the share accessible to them, etc.

Lets say you have a table of urls and date they were entered and by whom. user,date,url lets say is the table structure... your data might look like this:
Code:
'john','13221524310951131','http://google.com/'
'pete','13221524310962326','http://yahoo.com/'
'sesm','13221524310994942','http://linuxquestions.org/'
using the example you gave of say, jpgs maybe this:
Code:
'sesm','13221524310951131','file:///P:/FileShare/Images/2009-04-23-000001.jpg'
'sesm','13221524310951131','ftp://user:pass@site.domain.tld/images/2009-04-23-000002.jpg'
'sesm','13221524310951131','http://www.domain.tld/images/2009-04-23-000002.jpg'
Your application that is using the database has to determine how to display this information or present it to the user... for all it matters the database could just contain a filename and the application builds the rest of the url.

Last edited by rweaver; 04-24-2009 at 02:28 PM.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can i copt the MYSQL Database to a other server (Database) halvorls Linux - Server 3 07-27-2008 09:19 PM
Where are the database files for mysql in Centos 5? Anauj0101 Linux - Server 5 02-23-2008 05:39 PM
fixing mysql database table without phpmyadmin c0c0deuz Linux - Server 3 12-01-2007 08:17 PM
need to convert text files into mysql database zafar466 Linux - Software 1 08-28-2007 12:53 AM
Mysql - Copying database files. jackster Linux - Software 2 02-03-2005 02:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration