adolfo
|
| Posted: 02/01/2005, 10:58 AM |
|
Despite the various suggestions to not upload files in a mysql table that I have read in this forum, I am in desperate need to learn how to do this with CCS.
I would be very grateful if anyone could send me a tutorial of how to do this usung the File Upload component.
thank you very much.
|
|
|
 |
klw
|
| Posted: 02/01/2005, 12:19 PM |
|
The FileUpload component is not designed to upload
files directly into your MySQL tables, it's designed to
provide you a reference (URL) which can be inserted into
your table instead. This is very flexible, takes minimal
diskspace, and allows you to place the actual data files
anywhere on your server.
All the suggestions you have gotten as to why you shouldn't
be storing files directly in your MySQL tables are most likely
all very valid, but you obviously need to do this, so here's a
suggesstion on how you might want to go about doing this:
The FileUpload component can be used to get the file copied
to your remote system, and after it's copied, you'll need to stream
the file into a variable which can be used to set a binary large object
(BLOB) within your MySQL table.
Step-1 : Use FileUpload to copy the file to your system.
Step-2 : Stream the file into a variable.
Step-3 : Store the variable as a BLOB object within your MySQL table.
|
|
|
 |
adolfo
|
| Posted: 02/01/2005, 12:31 PM |
|
klw,
Thank you very much for the advice. The reason I cannot upload files to the server filesystem is due to a security policy imposed by the client I am developing a system for.
If I understood your suggestion, I have to use the After Process File event to stream(?) the file into a BLOB field using fread, fopen commands?
Rgds,
adolfo
|
|
|
 |
peterr
Posts: 5971
|
| Posted: 02/01/2005, 1:54 PM |
|
I've never done this, but I suspect that there may be a simpler way. Here is one article on how to do this purely with PHP & MysQL: http://www.onlamp.com/pub/a/php/2000/09/15/php_mysql.html
So it may be only a question of figuring out how to use that method with CCS. One simple way could be to create a pop-up page where users can upload files (similar to http://examples.codecharge.com/CCSExamplePack2/FileUpload/FileUpload.php ), but create that pop-up page without using CCS -just use simple HTML and Add.php that the author of that article provided.
BTW, you may want to explain to your client the downsides of using this method. The other method of storing files on the disk can offer sufficient security since that method is probably used by most companies and Websites. Unless the performance is less important than security
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
Anothersledhead
Posts: 44
|
| Posted: 02/02/2005, 7:31 PM |
|
I too have a need for a Binary Upload component for CCS. I was actually been trying build a Binary Upload last night but creating events are still a bit over my head at this time. Any help from more experienced users would be appreciated.
Thanks in advance!
|
 |
 |
|