Giter VIP home page Giter VIP logo

Comments (5)

PanchoVarallo avatar PanchoVarallo commented on July 22, 2024 1

Hi @N4S4,

thanks for you hint. Okay, things are confusing, I try to clarify:

  • The Upload Complete message is perfectly returned in 0.4.4
  • I checked the code for upload_file(...) in filestation.py for tag 0.5 and everything looks good:
    def upload_file(self, dest_path, file_path, create_parents=True, overwrite=True, verify=False):
    api_name = 'SYNO.FileStation.Upload'
    info = self.file_station_list[api_name]
    api_path = info['path']
    filename = os.path.basename(file_path)
    session = requests.session()
    with open(file_path, 'rb') as payload:
    url = ('%s%s' % (self.base_url, api_path)) + '?api=%s&version=%s&method=upload&_sid=%s' % (
    api_name, info['minVersion'], self._sid)
    args = {
    'path': dest_path,
    'create_parents': str(create_parents).lower(),
    'overwrite': str(overwrite).lower(),
    }
    files = {'file': (filename, payload, 'application/octet-stream')}
    r = session.post(url, data=args, files=files, verify=verify)
    if r.status_code == 200 and r.json()['success']:
    return 'Upload Complete'
    else:
    return r.status_code, r.json()
  • But then I installed 0.5 with pip and here the problem occurs. I checked the source code on pypi and saw that upload_file(...) in filestation.py looks different and causes the described problem ....

Am I doing something wrong or is there a diff between 0.5 on Github and pypi?

Thanks!

Best,
@PanchoVarallo

from synology-api.

PanchoVarallo avatar PanchoVarallo commented on July 22, 2024 1

Sorry for the delay.

Looks perfectly now. Thanks for the fast fix. Now I can upgrade ...

from synology-api.

N4S4 avatar N4S4 commented on July 22, 2024

Hi,
the upload function did not change through the versions, strange did not output anything.
I just run it and got it successful,

image

Is that really wanted?

actually not

can you show (if feasible your request? was the upload successful but output nothing?

from synology-api.

N4S4 avatar N4S4 commented on July 22, 2024

Oh no you might be right!
I maybe accidentally upload a different file while i was trying to make upload in chunks! I will have a look straight away and let you know

Thank you for reporting!

from synology-api.

N4S4 avatar N4S4 commented on July 22, 2024

Hi,

could you check it now? tnx again

from synology-api.

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.