Your workflow is unique 👨‍💻 -  tell us how you use Dropbox here.

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.

2 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    7 years ago
    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
    7 years ago

    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 and Feedback

Node avatar for Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.

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!