guerob
Posts: 3
|
| Posted: 12/01/2004, 4:40 PM |
|
I was wondering if this exists in CCS, or if it is possible to have implemented : an "Upload Builder"... the reason is we need a user to be able to upload pdf files to blob fields in a MySql database.
Thanks !
|
 |
 |
klwillis
Posts: 428
|
| Posted: 12/01/2004, 4:55 PM |
|
You can add a File Upload component within the forms components,
but there is no builder (yet ) for file uploading.
BTW:
I recommend NOT uploading the .pdf files into the MySQL database,
just the path to the file. The FileUpload component allows you to add
the path to the file nicely.
_________________
Kevin Willis, VP/CIO
HealthCare Information Technology Specialist
http://www.nexushealthcare.com
"Fast - Convenient - Quality-Care"
Medical Software Consulting Services
Email : klwillis@nexushealthcare.com
Skype : klwillis2006 |
 |
 |
guerob
Posts: 3
|
| Posted: 12/01/2004, 5:20 PM |
|
Hi,
How could I presently use/configure the file upload component to upload an image or a pdf in a blob field at each specific record ?... I guess that an upload builder module would be necessary to get this uploading code right for a blob upload...
I understand your comment that I could simply indicate the URL to a pdf in a url_to_pdf field in a record, but I need to reserve the access to the pdf file to the person who has permission to access the specific record (each record will have a specific user_name/password combination), so I need to upload .pdf files into a bolb field in the database. I am doing it right now with Navicat and it works fine, but I would like to program this functionality with CCS...
Thanks ! javascript:insert_smiley(' ')
|
 |
 |
guerob
Posts: 3
|
| Posted: 06/17/2005, 5:56 AM |
|
Can we expect to have a CSS Upload Builder for BLOBs in a foreseeable future ?
Hi,
I am still hoping for CSS to implement an "Upload Builder" to upload pdf files to blob fields in a MySql database... It seems that every time I read about this topic here in the Forum that it is always answered that you "do not recommend this" and then suggest the FileUpload method... The FileUpload is just elementary coding, and is "not" the functionality required since in certain applications there is a priority "need" for the security of reserving the access of the blob (a pdf) to for example 1 user per record. There is no issue at all with performance in the project I am contemplating since the database will be accessed by few and just occasionally. I was hoping to see an Upload Builder for BLOBs in this next version (3) of CSS since klwillis hinted this to a certain extent when he wrote "there is no builder (yet ) for file uploading"... So can we expect to have a CSS Upload Builder for BLOBs in a foreseeable future ? ....
Thanks !
|
 |
 |
peterr
Posts: 5971
|
| Posted: 06/17/2005, 6:36 AM |
|
Possibly, based on the number of such requests submitted to our support, or to the Wishes forum.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
wkempees
Posts: 1679
|
| Posted: 06/20/2005, 11:15 AM |
|
First:
Create the normal upload facility (PhP) to fully function.
Accepting the file upload, doing the actual copy to the server and so on.
Get that working flawlessly.
The way I build the upload into the BLOB type field is:
1) Create an "After Process File" Custom Code
2) read the uploaded file into a variable
3)(SQL) UPDATING the database setting the BLOB field to the data just read.
4) Optionaly unset(fname) to delete the uploaded file
5) Beware, if you try to udate the form in which the fileupload is situated it will complain about not being able to find the original file.
This is a rough answer, but give it a try.
If I could figure it out............
XXXX is your table name
xxxx is the field name.
[source]
//xxxx_AfterProcessFile @47-7B1ACE35
function xxxx_AfterProcessFile()
{
$xxxx_AfterProcessFile = true;
//End xxxx_AfterProcessFile
//Custom Code @50-8A470B2F
// -------------------------
global $XXXX;
// Write your own code here.
$fname = 'upload/' . $XXXX->xxxx->GetValue() ;
$fsize = $XXXX->xxxx->GetFileSize() ;
$fhandle = fopen($fname,"r");
$fcontent = fread($fhandle, $fsize);
// $fcontent = addslashes($fcontent);
//
$db = new datasource;
$SQL = "UPDATE `XXXX` SET name_of BLOB_field =". $db->ToSQL($fcontent,ccsMemo)
." WHERE id=". $db->ToSQL(CCGetFromGet("id",""),ccsInteger);
//echo $SQL;
$db->query($SQL);
$db->close();
// -------------------------
//End Custom Code
//Close XXXX_xxxx_AfterProcessFile @47-5FAA70B5
return $XXXX_xxxx_AfterProcessFile;
}
//End Close XXXX_xxxx_AfterProcessFile
[/source]
Please note We are not discussing wether to store or not to store Binary Large Objects into BLOBS, because some of us just HAVE to.
Greets Walter.
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
|