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

Forum Discussion

Jason_gu's avatar
Jason_gu
New member | Level 2
5 years ago
Solved

stone.backends.python_rsrc.stone_validators.ValidationError

i have a imagefield in my model, but when i upload an image, i get this error:
stone.backends.python_rsrc.stone_validators.ValidationError: 'C:\nirpics\italian-tomato.jpg' did not match pattern '(/(.|[\r\n])*|id:.*)|(rev:[0-9a-f]{9,})|(ns:[0-9]+(/.*)?)'

I've searched for the solutions, but none of them does the work. Anyone can help me out?

3 Replies

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

    When uploading a file to Dropbox via the API, you need to specify the path in Dropbox where you want to put the file. I see you're supplying a path 'C:\nirpics\italian-tomato.jpg', but that's a local Windows filesystem path, not a Dropbox path. For example, a Dropbox path would look like '/nirpics/italian-tomato.jpg'.

     

    I recommend reading the File Access Guide for more information.

  • Jason_gu's avatar
    Jason_gu
    New member | Level 2
    5 years ago

    Thank you Greg, the link's dead, but i can find the documentation. My problem is my code works well on Mac, but on Windows it doesn't. I've tried to locate where the variable 'path' is, but i failed.

     

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

    Apologies for the trouble. It looks like there's an issue with the routing for that page when using a non-English locale. We'll look into it. For now, you should be able to work around that and access https://developers.dropbox.com/dbx-file-access-guide by temporarily switching to the "English (United States)" locale on https://www.dropbox.com/account/general (if signed in) or https://www.dropbox.com/login?cont=https%3A%2F%2Fwww.dropbox.com%2Fhome (if not signed in).

     

    Anyway, the "path" parameter is the parameter you send to the API when uploading a file to specify where in the Dropbox filesystem to put the file. For example, when using the Python SDK, that's the "path" parameter on the files_upload method.

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!