Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

DeeG2009's avatar
DeeG2009
Explorer | Level 3
3 years ago

Help with python script uploading images to already created folders

I am looking for some assistance with a script i am trying to get to work to transfer images from a windows server to a dropbox account. For the life of me i cannot get it to stop creating new folders. I am trying to get it to upload to existing folders using the destination folder that appears in the browser url string of the desired folder. Anyone willing to help me out on this ill be glad to share the script, i am very green to all of this so i am hoping it is just something silly i am overlooking. Thanks in advance. 

15 Replies

Replies have been turned off for this discussion
  • Здравко's avatar
    Здравко
    Legendary | Level 20
    3 years ago

    DeeG2009 wrote:

    ..., ive been messing with this for almost a week now, and thats all it was. "/CPGC/Akron/" is working just fine to the existing folder. ...


    As Greg correctly supposed and you skipped to say, you are running team account, not personal. Your initial path is correct and would work for personal account. By default upload path starts from your home folder; for personal account home folder and account root is the same thing, but for team account it's not (and that's where your issue comes from).

     


    DeeG2009 wrote:

    ...

    I am assuming it is because when my script runs it will name the images, example: image1.jpg,image2.jpg, etc... and once stopped and started again it starts at 1 again and will not overwrite, Could a timestamp always keep the naming unique ?

    ...


    If you want to overwrite, you have to specify it explicitly. Auto-rename should be specified if desirable too.

     


    DeeG2009 wrote:

    ...

    My ultimate goal is to be able to have the script run down a list of lines in a csv instead of just one line, each line in the csv would be for different folders and corresponding data for each image to be uploaded to, but i cant figure out how to have the script run each line in the csv say 10 times, then move on to the next and so on... 


    As far as I can see, you want to append line(s) to a csv file. Unfortunately, Dropbox doesn't provide such a feature. You have to upload entire file. 🤷 That's it.

  • DeeG2009's avatar
    DeeG2009
    Explorer | Level 3
    3 years ago

    "As far as I can see, you want to append line(s) to a csv file. Unfortunately, Dropbox doesn't provide such a feature. You have to upload entire file. 🤷 That's it."

     

    so i cannot have 50 lines in the csv file to upload to 50 different folders 1 by one, or 10 by 10, etc...? that seems like it is up to the code not drop box. if it can upload to one dropbox folder, it should be able to read a list of destinations right?

  • Здравко's avatar
    Здравко
    Legendary | Level 20
    3 years ago

    That what I said is you can't append to a file, nothing more. You can have whatever you want wherever you want. Just every next version should be uploaded anew.

  • DeeG2009's avatar
    DeeG2009
    Explorer | Level 3
    3 years ago

    I apologize, i am just not understanding what it is you are trying to say. You have to act like you are talking to a child with me haha. 

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    3 years ago

    DeeG2009 Здравко was pointing out that the Dropbox API does not offer functionality for just appending additional data to an existing file on Dropbox. For example, if there's an existing files uploaded on Dropbox that is 5 bytes long, there isn't a way for your app to upload just an additional 1 byte to make the resulting file 6 bytes long. You would need to upload the whole 6 bytes.

     

    It's not clear to me if you necessarily need such a feature but regardless you of course control the execution flow of the logic in your code. You can write logic to issue 1 or 10 or however many calls to the Dropbox API as/when you need, in whatever order.

About Discuss Dropbox Developer & API

Node avatar for Discuss Dropbox Developer & API
Make connections with other developers

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!