pulsorock
Posts: 28
|
| Posted: 06/17/2008, 1:58 PM |
|
Hello,
I have a problem. I use the record builder to create/manage a record from my table. This record has two upload fields (flv video file and jpg snapshot file). However these two files are moved to another server (streaming server) via a cron job that monitors the upload folder after the file is completely uploaded. The problem I have is that if I want to modify an specific record, I get file not found for these two fields that were already moved to the other server. But if I tray to change anything on the record (any text of value on the other fields) it won't let me do anything to the record because these two files don't exist.
Is there a way around this? A way of ignoring if the file exist on the folder or not?
This is kind of an urgent question, since I'm presenting this project tomorrow and I just came up with this problem.
Thanks!
|
 |
 |
mentecky
Posts: 321
|
| Posted: 06/17/2008, 2:10 PM |
|
Well, if you don't care about errors in edit mode... you can try the following:
Click the control. In the On Validate event add custom code. Then add someting like this:
if ($myform->EditMode)
{
$Component->file_control->Errors->Clear();
}
Since On Validate happens after errors are set, this should clear any errors for paths.
Rick
_________________
http://www.ccselite.com |
 |
 |
mentecky
Posts: 321
|
| Posted: 06/17/2008, 2:14 PM |
|
I hate typos... I meant:
if ($myform->EditMode)
{
$Component->Errors->Clear();
}
_________________
http://www.ccselite.com |
 |
 |
pulsorock
Posts: 28
|
| Posted: 06/17/2008, 2:18 PM |
|
Would that also affect errors like invalid file type or size to be shown? Would that just apply to the specific control (ie: just the two uploads fields) or the complete record builder?
Thanks
|
 |
 |
mentecky
Posts: 321
|
| Posted: 06/17/2008, 2:20 PM |
|
It applies to the specific control, so you have to do it for each one. But it should work as long as you don't care about the file names after they are in the DB.
Rick
_________________
http://www.ccselite.com |
 |
 |
pulsorock
Posts: 28
|
| Posted: 06/17/2008, 2:24 PM |
|
Ok, I'll try it to see how it goes... will post what happens in a while... thanks
|
 |
 |
mentecky
Posts: 321
|
| Posted: 06/17/2008, 2:35 PM |
|
Quote pulsorock:
Ok, I'll try it to see how it goes... will post what happens in a while... thanks
BTW, $myform is the name of your record, replace it with your global variable.
Rick
_________________
http://www.ccselite.com |
 |
 |
pulsorock
Posts: 28
|
| Posted: 06/17/2008, 2:36 PM |
|
I'm back...
I tried it, added this line to the On Validate event for each of the two components.
if ($wapa_news_content->EditMode)
{
$Component->Errors->Clear();
}
At first I get the error:
Quote :The file clip1.jpg specified in images was not found.
The file clip1.flv specified in FLV_Movie was not found.
But when I clicked the update I get this error:
Quote :The file /var/www/wapa_uploads_tmp/clip1.jpg specified in images was not found.
The file /var/www/flv_files_tmp/clip1.flv specified in FLV_Movie was not found.
It tries to look for the files in the temp folder and stills gives errors.
Any idea?
|
 |
 |
mentecky
Posts: 321
|
| Posted: 06/17/2008, 2:48 PM |
|
Can you create an edit page without the upload controls? Granted, it's two pages to edit on changes, but it may be your best bet.
Rick
_________________
http://www.ccselite.com |
 |
 |
pulsorock
Posts: 28
|
| Posted: 06/17/2008, 3:09 PM |
|
There's no other option? I need the upload fields in case they need to re-upload these files.
|
 |
 |
mentecky
Posts: 321
|
| Posted: 06/17/2008, 3:20 PM |
|
I'm guessing because you use a chron job that there is no way to map the files to a local folder. You may need to go hardcore and use a 3rd party upload component rather than the stock one. I use upload a lot, but they are always local folders so I'm out of ideas.
Sorry,
Rick
_________________
http://www.ccselite.com |
 |
 |
pulsorock
Posts: 28
|
| Posted: 06/18/2008, 7:51 AM |
|
Could be a way that the class that verifies if the file exist check an external utl for the file instead of the local file?
For example...
I upload the file using the upload module lo a local path. But in Edit Mode, the class that verifies if the file exists locally, instead of looking for it at path "/var/www/website/uploads/filename.flv" looks for it at "http://videos.domain.com/filename.flv".
That way, in Edit Mode the file would still exist and it wont give the file not found errors.
|
 |
 |
pulsorock
Posts: 28
|
| Posted: 06/18/2008, 11:18 AM |
|
I think that what would be best to my solution is run the content manager created with CCS to be run in the server that the files will be hosted instead of the main apache server. This way the files will be hosted locally in the same server. The only difference is that the server where the files are being moved runs lighttpd instead of apache, but I guess that wont be a problem with CCS, right?
|
 |
 |