Giter Site home page Giter Site logo

Comments (5)

signalpoint avatar signalpoint commented on August 19, 2024

@fufu7755 I'd use the File plugin with Cordova, then use it to retrieve a base 64 encoded string of your image, then follow this example to get the picture into Drupal: http://tylerfrankenstein.com/code/drupal-services-file-create-example-json-and-jquery - just change the jQuery to Angular syntax

from angular-drupal.

fufu7755 avatar fufu7755 commented on August 19, 2024

Hi @signalpoint thank you for your reply. Now, I have get the image and retrieve it to base 64 encoded string, then I use drupal.file_save function to save it, but return me a error message "Not found : Could not find resource file.". Please give me some help again.Thank you.
wechatimg1

from angular-drupal.

signalpoint avatar signalpoint commented on August 19, 2024

@fufu7755 You need to turn on the File service and subsequent Resources in Drupal here:

admin/structure/services/list/[my-endpoint-name]/resources

You need to enable the Create resource and grant permissions for user role(s) to use the Save binary file permission. Then flush Drupal's caches, and that should fix it.

Once completed, it'll return to you the new file id from Drupal.

from angular-drupal.

fufu7755 avatar fufu7755 commented on August 19, 2024

@signalpoint Thank you very much!

from angular-drupal.

signalpoint avatar signalpoint commented on August 19, 2024

@fufu7755 You're welcome. After that you can just make a node save/update call and send along this JSON without the node object:

field_my_image: {
  und: [
    { fid: 123 }
  ]
}

That'll set the file id onto the field for your node, good luck!

from angular-drupal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.