Yes, Thomas, I did look at the manual but I have this test-code (that
by the way works excellently with the filter to change the name of the
file to underscores instead of spaces all thanks to your code, that is
really great and I thank you for that):

if ($form->isValid($_POST)) {
        $filsokvag = $filuppladdning->getFilename();
        $filnamnsfilter = new Zend_Filter_BaseName();
        $sokvagsfilter = new Zend_Filter_Dir();
        $mellanslag2understreck = new
Zend_Filter_Word_SeparatorToSeparator(' ','_');
        $filnamnet = $filnamnsfilter->filter($filsokvag);
        $sokvagen = $sokvagsfilter->filter($filsokvag);
        $gammalsokvag = $sokvagen ."/".$filnamnet;
        $nya_filnamnet = $mellanslag2understreck->filter($filnamnet);

        $nyafilsokvag = $sokvagen ."/" .$nya_filnamnet;
        $filadapter->addFilter('Rename',array(
                                'source' => $gammalsokvag,
                                'target' => $nyafilsokvag,
                                'overwrite' => true
                                             )
        );
        $filadapter->receive();
etc...

But if I change the directory rights to only read I get the message:
Warning: 
move_uploaded_file(/var/www/Testa_Div_Zend_framework/div_dokument/testa.odt)
[function.move-uploaded-file]: failed to open stream: Permission
denied in /var/www/ZendFramework/library/Zend/File/Transfer/Adapter/Http.php
on line 102

I've tried to do all sorts of things with if (!$filadapter->receive()
etc but nothing works. It seems like it accepts $filadapter->receive()
as true although it can't move the file from tmp to the destination.

Would be really grateful for help with sorting this out.


2009/1/23 Thomas Weidner <thomas.weid...@gmx.at>:
> Bertil,
>
> Whatever you mean with upload but move_uploaded_file is part of PHP itself.
> It does handle invalid write permission.
>
> And also Zend_File_Transfer handles invalid write permissions and return an
> exception is this case with the proper message text.
> Have you tried it out or are you just looking at the code unable to find out
> how it works ? :-)
>
> Take a look at the manual or the examples which can be found around in the
> net.
>
> Greetings
> Thomas Weidner, I18N Team Leader, Zend Framework
> http://www.thomasweidner.com
>
>
> ----- Original Message ----- From: "Bertil Wergelius"
> <bertil.wergel...@gmail.com>
> To: <fw-general@lists.zend.com>
> Sent: Friday, January 23, 2009 12:03 PM
> Subject: [fw-general] File_Transfer move_uploade_file permision denied
>
>
>> Why doesn't Upload catch the possibility that the destination catalog
>> has no write privileges?
>> I used to have a class for image uploads with this code sample:
>> if ($fel==UPLOAD_ERR_OK) {
>>        if (!($flytta_f...@move_uploaded_file($tempfil,$malet))) {
>>           return("Flyttning av filen misslyckades");
>>        } else {
>> etc
>> and that works fine. But I can't figure out how that would be done in
>> or with Zend_File_Transfer.
>
>

Reply via email to