PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
HTTP_Request, how to change file download location

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> HTTP
View previous topic :: View next topic  
Author Message
Demoder



Joined: 27 Aug 2008
Posts: 3

PostPosted: Wed Aug 27, 2008 7:02 am    Post subject: HTTP_Request, how to change file download location Reply with quote

Hello there.

Is there any way to tell HTTP_Request which path to use as a temporary storage area while it downloads a file? I would love to tell it to temporarly save the file in "./tmp/", to avoid risking it overwriting any files in the workdir.

Thanks in advance.


EDIT: It was late. Some false assumptions. Updated request.
Back to top
View user's profile Send private message
Demoder



Joined: 27 Aug 2008
Posts: 3

PostPosted: Wed Aug 27, 2008 10:09 am    Post subject: Reply with quote

Some sleep helped on the case.
I missed the sections:
Code:
function setTarget($target)
    {
        $this->_target = $target;
        $this->_fp = @fopen($target, 'wb');
        if (!$this->_fp) {
            PEAR::raiseError("Cannot open '{$target}'");
        }
    }

and
Code:
case 'tick':
          $this->_size += strlen($data);
          $this->_bar->update(round($this->_size / 1024));
          fwrite($this->_fp, $data);
          break;

in the HTTP_Request_DownloadListener class.
Removing these parts, and adding a second download listener with some more options for where to place the file, solved the issue.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> HTTP All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement