We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

hrh747's avatar
hrh747
Helpful | Level 5
4 years ago

I cannot edit file

Hi,

As part of my familiarization with the Dropbox APIs, I have successfully uploaded a file using the API onto a folder in my Dropbox account. This is the ONLY app folder I have set up in Dropbox (not shared). However, the file is not editable, so I can't change its content manually in Dropbox. I don't seem to find a way to change the permission. Following are the screen-shots of the Settings and the Permissions.

  

  • Thanks for following up and clarifying. It sounds like you're referring to trying to edit a text file on www.dropbox.com. The Dropbox web site doesn't offer text editing functionality for .txt files like that, but you have several options of other ways to edit the file, such as:

    • You can edit the file locally on your computer if you have the Dropbox desktop client installed, in which case the change will sync to Dropbox automatically.
    • You can download the file, edit it locally, and then upload the new version.
    • You can use the the files_upload method again to upload a new version of the file data.
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    Can you elaborate on what you mean when you say "the file is not editable"? Please share the steps and code you're following that lead to the issue, as well as whatever unexpected error or output you're getting. Be sure to redact any access token or refresh token though.

    • hrh747's avatar
      hrh747
      Helpful | Level 5

      Hi Greg,

       

      Here is the code that I used to upload the file to Dropbox:

      with open(LOCAL_FILE, 'rb') as f:
      # We use WriteMode=overwrite to make sure that the settings in the file
      # are changed on upload
      print("Uploading " + LOCAL_FILE + " to Dropbox as " + BACK_UP_PATH + "...")
      try:
      dbx.files_upload(f.read(), BACK_UP_PATH, mode=WriteMode('overwrite'))
      except ApiError as err:
      ...........................

       Once the file is uploaded, I login to my Dropbox account, locate the file in my Dropbox app folder and open it, however, I can't change its content. The first line in the file is 'Scheduled Operation: False' and I would like to change 'False' to 'True' but I can't. I don't get any errors but the file seems to be read-only.

       

      Hope this helps

       

      • Greg-DB's avatar
        Greg-DB
        Icon for Dropbox Staff rankDropbox Staff

        Thanks for following up and clarifying. It sounds like you're referring to trying to edit a text file on www.dropbox.com. The Dropbox web site doesn't offer text editing functionality for .txt files like that, but you have several options of other ways to edit the file, such as:

        • You can edit the file locally on your computer if you have the Dropbox desktop client installed, in which case the change will sync to Dropbox automatically.
        • You can download the file, edit it locally, and then upload the new version.
        • You can use the the files_upload method again to upload a new version of the file data.