I am glad to say that this problem is a windows problem. My local host is a 
windows machine, but this is just for testing. My actual server is a linux 
machine and dropbox put_file works fine on the linux machine. 

Peter

On Thursday, 13 September 2012 14:17:28 UTC+1, peter wrote:
>
> This is not exactly a web2py issue, but other users might have useful 
> input, and the answer will maybe help others. I am trying to put a file 
> onto dropbox. After setting everything up, I do
>
>     f = open('myfile.zip')
>     client.put_file('myfile.zip',f)
>
> If the file is a small textfile it works fine. However with a zipfile of 
> only 720KB I get. 
>
> TRACEBACK
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
> 17.
> 18.
> 19.
> 20.
> 21.
>
> Traceback (most recent call last):
>   File "C:\Users\Peter\web2pyn\gluon\restricted.py", line 205, in restricted
>     exec ccode in environment
>   File "C:/Users/Peter/web2pyn/applications/new_spin2/controllers/default.py" 
> <http://127.0.0.1:8002/admin/default/edit/new_spin2/controllers/default.py>, 
> line 594, in <module>
>   File "C:\Users\Peter\web2pyn\gluon\globals.py", line 173, in <lambda>
>     self._caller = lambda f: f()
>   File "C:/Users/Peter/web2pyn/applications/new_spin2/controllers/default.py" 
> <http://127.0.0.1:8002/admin/default/edit/new_spin2/controllers/default.py>, 
> line 576, in backup_to_dropbox
>     client.put_file('f1/'+'abc.zip',f)
>   File "build\bdist.win-amd64\egg\dropbox\client.py", line 352, in put_file
>     return self.rest_client.PUT(url, file_obj, headers)
>   File "build\bdist.win-amd64\egg\dropbox\rest.py", line 265, in PUT
>     return cls.IMPL.PUT(*n, **kw)
>   File "build\bdist.win-amd64\egg\dropbox\rest.py", line 211, in PUT
>     return self.request("PUT", url, body=body, headers=headers, 
> raw_response=raw_response)
>   File "build\bdist.win-amd64\egg\dropbox\rest.py", line 174, in request
>     raise util.AnalyzeFileObjBug(clen, bytes_read)
> AnalyzeFileObjBug: 
> Expected file object to have 736338 bytes, instead we read 201 bytes.
> File size detection may have failed (see dropbox.util.AnalyzeFileObj)
>
>
> I have googled this with no joy.
>
> Any suggestions
>
> Peter
>
>

-- 



Reply via email to