Coder Social home page Coder Social logo

Comments (3)

tomgross avatar tomgross commented on July 18, 2024

Hi @TheCrazyT please see the documentation on how to upload: https://github.com/tomgross/pcloud/blob/master/README.rst#uploading-files

from pcloud.

TheCrazyT avatar TheCrazyT commented on July 18, 2024

I was more interested in appending data to existing files (so I needed to use "opener.open_fs" with append-flag).
Thats why i was not able to use "uploadfile".

As mentioned before the fd-param does not get set.
Although this is fine with "normal" uploads, it won't work if you use "pcloudfs".
But I got around the bug by patching the code by commands.

Btw:
The commands I used for patching are:

sed -i 's/kwargs.pop("fd", None)/fd=kwargs.pop("fd", None)/' pcloud/api.py
sed -i 's/self.endpoint + method, data=m, headers={"Content-Type": m.content_type}/self.endpoint + method + f"?fd=\{fd\}", data=m, headers=\{"Content-Type": m.content_type\}/' pcloud/api.py

(I'm using those commmands in a jupyter notebook ... therefore was not able to edit the files by hand)
Not shure if fd needs to be a query-parameter or can be a POST-parameter (can't remember if I tried as POST-param and it didn't work)

from pcloud.

tomgross avatar tomgross commented on July 18, 2024

Fixed with 1.3 https://pypi.org/project/pcloud/1.3/

from pcloud.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.