0

i had on my _users document attachment image file i want my background image change with each user this code is not work with me

background-image: url(http://localhost:5984/_users/org.couchdb.user:test1/spaces_man.png);

and the console say [HTTP/1.1 404 Object Not Found 10ms]

2

2 Answers 2

0

This strikes mo as extremely insecure. Unless you have no login requirement to access your database you can use this to access all the document is your db.

  • Option 1:

Create an API that accesses just the image. Ideally you should check in the process that you are actually logged in, eg. you could pass some form of authorization to your API in order to return the image.

  • Option 2:

Store all images on a separate file system and just store the URL in your user object, rather than manage it as an attachment.

1
  • i try option 2 but it need to create it with php and i search now to make couchdb and php work together cus i dont know how i upload image just from couchdb and couchapp, about option1 i pass the admib user and pw and didnt work too
    – amrnavy
    May 21, 2014 at 12:44
0

what is the best API php/couchdb to upload image and if there are links for examples ,or the way to show my _attachment pic from my couchdb to html by this code background-image: url(http://localhost:5984/_users/org.couchdb.user:test1/spaces_man.png);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.