Logo Search packages:      
Sourcecode: zope-extfile version File versions

def zope-extfile-1.4.2::ExtFile::ExtFile::manage_http_upload (   self,
  url,
  REQUEST = None 
)

Upload file from http-server 

Definition at line 435 of file ExtFile.py.

00435                                                    :
        """ Upload file from http-server """
        if self.wl_isLocked():
            raise ResourceLockedError, "File is locked via WebDAV"
                            
        url = urllib.quote(url,'/:')
        cant_read_exc = "Can't open: "
        try: file = urllib.urlopen(url)
        except: raise cant_read_exc, url
        file = HTTPUpload(file)
        self.content_type = self._get_content_type(file, file.read(100),
                            self.id, self.content_type)
        file.seek(0)
        self._register()    # Register with TM
        try:
            new_fn = self._get_ufn(self.filename)
            self._update_data(file, self._temp_fsname(new_fn))
        finally: self._dir__unlock()
        self.filename = new_fn
        self._afterUpdate()
        if REQUEST is not None:
            return self.manage_main(self, REQUEST, manage_tabs_message='Upload complete.')                
    
    security.declareProtected(ChangePermission, 'PUT')
    def PUT(self, REQUEST, RESPONSE):


Generated by  Doxygen 1.6.0   Back to index