How to create endpoint in angular to upload a image?

Discussão em 'Angular' iniciado por Aaqib, Fevereiro 13, 2025.

  1. Aaqib

    Aaqib Guest

    I have used kolkov angular editor in my angular application to create rich text editor.

    Now I want to upload the image from it to the server. I also have the function that takes a file as an argument and sends it to the server.

    uploadImage(file, viewable_type = "Spree::Vendor", viewable_id=null) {
    .............
    .............
    return this.http.post(this.apiV2Url + '/attach_image'+ "?access_token=" + this.accessToken,
    file, options).map(this.extractData).catch(this.handleError);
    }


    Now in order to pass the image from editor to the function, I have to give it some endpoint URL.

    I want to know how can I create an endpoint API which I can configure with the editor so It can send the file to the uploadImage function.?

    Continue reading...

Compartilhe esta Página