Forum Discussion

dbyy's avatar
dbyy
Explorer | Level 3
7 years ago

uploaded files don't exist in the folder iOS Swift3

I'm trying to upload a csv file in Swift3. 

The method looks working but the can't find the file in the folder.

The following is the log.

 

2018-07-16 01:41:09.057380+0900 MultiDirectionCollectionView[4231:1307144] dnssd_clientstub write_all(33) DEFUNCT

{

    "client_modified" = "2018-07-15T16:41:07Z";

    "content_hash" = a5c998a592ab3eae63b97d8f56024c1403c4ac6a2512740b318a3ce71789213b;

    id = "id:rk7x4l2SWGAAAAAAAAAADA";

    name = "FromiOS.csv";

    "path_display" = "/FromiOS.csv";

    "path_lower" = "/fromios.csv";

    rev = e58109260;

    "server_modified" = "2018-07-15T16:41:08Z";

    size = 435;

}

2018-07-16 01:41:09.731898+0900 MultiDirectionCollectionView[4231:1307095] WF: _userSettingsForUser mobile: {

    filterBlacklist =     (

    );

    filterWhitelist =     (

    );

    restrictWeb = 1;

    useContentFilter = 0;

    useContentFilterOverrides = 0;

    whitelistEnabled = 0;

}

 

 

//code

 

 

            let path2 = "/" + str + ".csv"

            

            /*

            _ = DropboxClientsManager.authorizedClient?.files.upload(path: path2 , input: payload! )

                .response { response, error in

                    if let response = response {

                        //print(response)

                    } else if let error = error {

                        // print(error)

                    }

                }

                .progress { progressData in

                    //print(progressData)

            }

             */

            

            let request = DropboxClientsManager.authorizedClient?.files.upload(path: path2, mode: Files.WriteMode.add, autorename: true, clientModified: Date(), mute: true, input: payload!).response { response, error in

                if let response = response {

                    print(response)

                } else if let error = error {

                     print(error)

                }

                }

                .progress { progressData in

                    print(progressData)

            }

            

            

Thanks.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff
    That response does indicate that the file was successfully uploaded. There are a few things to check to make sure you're looking for it in the right place:

    - If your app is registered for the "app folder" permission, the files will be uploaded in a special "app folder" created for your app. If you are using that permission, make sure you're looking in that folder. It will be located inside the "/Apps" folder in your account, if your account is set to English, or a corresponding translation for other localizations.
    - Make sure you're looking in the same account as you're connected to via the API.
    - If you're looking via a desktop filesystem, make sure the desktop client is syncing properly.
    • dbyy's avatar
      dbyy
      Explorer | Level 3

      Thank you for your help.

      It's working now.

      I didn't add the re-direct code in the appdelegate class.

       

       

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,951 PostsLatest Activity: 2 hours ago
352 Following

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 or Facebook.

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!