Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1041219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:19:17+00:00 2026-05-16T15:19:17+00:00

I am using the MVC app as a service, so i have deleted the

  • 0

I am using the MVC app as a service, so i have deleted the views. I am able to make calls to the controller:

public class HomeController : Controller
{
    // GET: /Home/
    public string Index(string param1, string param2) {
       ...
    }

from the MFC app:

string URL(_T("http://localhost:2374/home/index/myparam1/myparam2"));
pHttpFile = dynamic_cast<CHttpFile*> (m_Session.OpenURL(URL));
if (pHttpFile) {
    CHAR szBuff[1024] = { 0 };
    while (pHttpFile->Read(szBuff, 1024) > 0) {
        info += szBuff;
        ...

Now to upload an XML file, i am trying this on the MFC client:

CHttpConnection *pHttpConn = m_Session.GetHttpConnection(_T("localhost:2374"));
if (pHttpConn)
{
    CHttpFile *pHttpFile = pHttpConn->OpenRequest(
        CHttpConnection::HTTP_VERB_POST,
        _T("file.xml"));
    DWORD dwRet = 0;
    pHttpFile->QueryInfoStatusCode(dwRet);
    if (dwRet == HTTP_STATUS_OK)
    {
        CString headers(_T("Content-type: text/xml; charset=utf-8"));
        if (pHttpFile->AddRequestHeaders(headers))
        {
            if (pHttpFile->SendRequestEx(xml.GetLength(), HSR_SYNC | HSR_INITIATE))
            {
                pHttpFile->Write(xml, xml.GetLength());
                pHttpFile->EndRequest(HSR_SYNC);
                ...

and this on the MVC side:

    [AcceptVerbs(HttpVerbs.Post)]
    public void FileUpload(HttpPostedFileBase uploadFile)
    {

The client executes without error, but nothing happens on server side. I am not sure how to get FileUpload() called in the Controller. Do i use MapRoute(), if so how?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T15:19:18+00:00Added an answer on May 16, 2026 at 3:19 pm

    There is no change nessecary on your server side.

    The problem is the c++ client. The url you should call to upload the file is http://localhost:2374/home/fileupload. If the method fileupload is in the home controller. You don’t need any other route for it.

    I found a code sample for upload a file with winnet at code project http://www.codeproject.com/KB/library/lyoulhttpclient.aspx. I’m not a c++ guy, may be there are more. But this one looks good.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a MVC app using the UnitOfWork, Service Layer, Repository Pattern and EF4
I have an ASP.Net-MVC app using LinqToSql. I have a subcontracts table, a service_lines
I have a MVC app and using JQuery. I have anchor that I setup
Using Unity in an ASP.Net MVC 2 app I have various dependencies on Controllers
I have an MVC-based site, which is using a Repository/Service pattern for data access.
I am using the Service/Repository/EF/POCO pattern in a MVC app, and had a couple
I am using the UnitOfWork/Service Layer/Repository/EF4 w/POCO design in my MVC app. So far
I have a medium sized asp.net MVC app. It consumes a service layer that
I have built a Spring 3 MVC driven RESTful web service app. I use
I am using spring mvc and spring security. In my security-app-context.xml I have: <authentication-manager>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.