Base solution for your next web application
Open Closed

File upload in Abp #2826


User avatar
0
bilalhaidar created

Hi I noticed the upload profile pic is using normal MVC controller while rest of appl using AppServices and Web API. Is there a preference or limitation to not use AppServices?

Thanks


4 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    We think it is the natural way of doing file upload for web. I personally didn't do file upload with app services before.

  • User Avatar
    0
    bilalhaidar created

    Hi Ismail,

    In my case, I am uploading a model including a file. Once the user finishes filling the form and uploads a file, I need to submit once to server.

    How can I access the HttpPostedFile in an AppService? Any way of doing so?

    Thanks

  • User Avatar
    0
    ismcagdas created
    Support Team

    I haven't tried it but it should work for app services as well. Just define a form like this

    <form enctype="multipart/form-data" method="post" action="UrlOfAppServiceMethod">
    //Fields here...
    </form>
    

    and submit it when user clicks submit button.

  • User Avatar
    0
    bilalhaidar created

    Thank you :-)