S
|
swanside 4/3/2010 |
Hello, I have a database for tracking purchases. As part of the purchase record I would like to keep a copy of the PDF receipt. Currently I'm uploading the receipt to a directory but I would like to change to uploading into the database. I watched the tutorial on uploading files but it doesn't cover uploading to the database. How is this done? On the "Attachment Edit As" window I don't see a way to tell it to upload to the database. My initial understanding was that if the field type is "text" the file would be linked to an upload directory and if the field type is "blob" the file would be stored in the database. However, I created a field type of blob and it still wants to upload the file to a directory. What am I doing wrong? Thanks for your help.
-- phpMyAdmin SQL Dump -- version 3.2.0.1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Apr 03, 2010 at 09:37 PM -- Server version: 5.1.36 -- PHP Version: 5.3.0 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; -- -- Database: import -- -- -------------------------------------------------------- -- -- Table structure for table table1 -- CREATE TABLE IF NOT EXISTS table1 (file longblob,ID int(11) NOT NULL AUTO_INCREMENT,filename varchar(50) DEFAULT NULL,PRIMARY KEY ( ID )) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ; -- -- Dumping data for table table1 -- INSERT INTO table1 (file , ID , filename ) VALUES(0x323031302d30332d32332030303a30303a3030, 3, NULL), (0x3832303930343036, 4, 'RAWTHORPE.txt'); |
![]() |
Sergey Kornilov admin 4/3/2010 |
Hammond, |
M
|
mrphp author 4/5/2010 |
Hammond, simply set 'Edit as' type of BLOB field to 'File/Image'.
|
S
|
swanside 4/5/2010 |
Did you try it the way I said? |
K
|
Khris 4/5/2010 |
Hammond, I've actually setup something very similar to this already which uploads copies of receipts and operation manuals into a directory based upon the username signed in. |
![]() |
Sergey Kornilov admin 4/5/2010 |
If you change field type from Text to BLOB you to synchronize your database. Proceed to 'Datasource tables' screen, right click on tables list and choose 'Synchronize'. |