Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

199
Views
How to Post BLOB data to asp.net webservice with ajax

I'm trying to post blob files to the web service, I couldn't find any solution. What I've tried so far is;

my ajax is;

            var model = new FormData();
            model.append("blob", blob);

            $.ajax({
                type: "POST",
                url: "../CreatePhoto",
                data: model,
                async: false,
                contentType: false,
                processData: false,
                success: function (data) {
                    if (data.d == true) {

                    } else {

                    }

                },
                error: function (e) {
                    console.log(e);
                }
            });

      

And my CreatePhoto.asmx.cs web service is;

 [WebMethod(EnableSession = true)]
 public bool CreatePhoto(HttpPostedFileBase blob){.....}

The problem is, when I try to trigger the ajax function, I'm getting this error on chrome logs;

 System.InvalidOperationException: CreatePhoto Web Service method name is not valid. 
at System.Web.Services.Protocols.HttpServerProtocol.Initialize()

I'm using a classic asp.net web application and my web service is also created with asp.net. There is plenty solution with MVC but, I'm trying to achieve this with asp.net.

ps: i'm able to trigger every other web services under the same URL.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!