Results 1 to 1 of 1
  1. #1

    Default Web API Upload File 415 Unsupported Media Type


    Mo dagan ra ang program C# .net console application. Maka upload ug file tawagon ang Web API.
    Mao ni ang main portion lang sa code :
    static async Task<string> UploadAttachment (HttpClient client, string attachmentsUrl, FileInfo file)
    {
    var content = new MultipartFormDataContent();
    var streamContent = new StreamContent(file.OpenRead(), 16384);
    streamContent.Headers.ContentType = new MediaTypeHeaderValue("application/binary");
    content.Add(streamContent, file.Name, file.Name)
    var attachmentUrl = await client.Post(attachmentsUrl, content);
    return attachmentUrl;
    }

    Ang problema sa Postman, ngano error man? 415 Unsupported Media Type.
    Unsaon pag tawag sa Web API nga sakto ang setup sa Postman para maka attach ug file?
    Postman ang gigamit kay naa pa next nga work buhaton need mag debug sa postman.

    Kinsa maka tabang dako gyod nako pasalamat!


    ------------------------

    Please close, nasakpan ra.
    form-data diay , dili binary ang body.
    Last edited by abloyboat; 10-17-2022 at 12:16 PM. Reason: Please close. Nasakpan ra

Similar Threads

 
  1. reasons for upload file failed?
    By nganuMAN in forum Support Center
    Replies: 10
    Last Post: 11-29-2010, 09:55 AM
  2. WEB SERVER - IIS Problem i can't view ASP Files... help pls
    By kibotizer in forum Websites & Multimedia
    Replies: 46
    Last Post: 08-01-2007, 11:59 AM
  3. convert .wmv (windows media audio/video) files to vcd format
    By iryn in forum Websites & Multimedia
    Replies: 4
    Last Post: 07-26-2006, 08:04 PM
  4. .3gp file types
    By doki in forum Software & Games (Old)
    Replies: 6
    Last Post: 11-07-2005, 12:43 PM
  5. Type na File Sytem na fit sa WinXP?
    By isone in forum Software & Games (Old)
    Replies: 11
    Last Post: 09-03-2005, 01:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top