Conrad, An alternative approach would be to render your model data as CSV through a view, i do this with just about every view I create now so the large datasets I deal with can be exported by users for manipulation in spreadsheets, data mining apps etc
You'd then need to put in place a separate regular (cron) job to perhaps pull this CSV view (wget is your friend, on *nix at least) and have that regular job send/write to your preferred location at regular intervals (a sort of crude middleware script!) That way you keep the cake app neutral (it just serves CSV to whomever asks for it, with appropriate permissions checking if required). It would be a lot more flexible that way. It seems a bit odd writing directly to an http address, but maybe that's just me. On 9/27/07, Conrad <[EMAIL PROTECTED]> wrote: > > > I am trying to create a .csv file from a table using fopen($file,"w") > to create it/open it. This csv will then later be downloaded and run > through a desk top check writing program, via an msaccess table. (not > my choice, but I didn't write the desktop application). > > I am getting the following errors: > Warning: fopen(http://www.trinityezpay.com/app/webroot/files/ > daily.csv) [function.fopen]: failed to open stream: HTTP wrapper does > not support writeable connections. in /home/trinity/public_html/app/ > controllers/process_controller.php on line 154 > > The code is as follows: > $file = $this->site_url.'/app/webroot/files/daily.csv'; > $this->file_error = 'Opened Daily.csv file successfully'; > $success = true; > if (is_file($file)) > { > unlink($file); > touch($file); > if (! chmod($file,octdec($mode))) > { > $this->file_error = "Won't chmod daily.csv"; > $success = false; > } > } // is file > if ($success) // if file open ok > { > if (!($fh = fopen($file,'w'))) --> this is the line with > the above > error. > -- > > This is legacy code converting to cake. It worked (at one time) as a > regular php program system. > > Any ideas? > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
