Base solution for your next web application
Open Closed

basic sample to upload file(s) with some custom fields input #3371


User avatar
0
mdonogma created

please can you enhance your walkthrough to show how to upload a file with each phonebook entry.

Need to see how to add custom fields + fields to your DB.

Your existing code on file uploads is too detailed to establish a simple working example.

More walkthroughs for beginners or your platform would be appreciated.

File upload has been requested many times on your forums and simply pointing users to existing code doesn't help. please provide a details step by step walkthrough on the topic else it doesn't really help the situations.

The more step by step walkthroughs you provide the more people will be able to use your platform + this will increase sales as more developers will be able to use it.

Suggest : dedicate a single 2 week sprint to only adding more walkthroughs. NEW features can wait as far as i'm concerned.


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

    Hi @Mdonogma,

    We appriciate your suggestions. More walkthroughs for beginners can be helpfull, you are right.

    Adding a new field to an entity is related to entity framework and it is very simple if you have used EF code first approach. Step by step PhoneBook document is for that purpose and it shows an example of creating a new entity. It will be same for adding a new field to an entity.

    Uploading a new file with extra fields is not much common I think but we can provide a sample here, which version do you use angular2 or jQuery ? We don't give this as a walkthrough officially, becaue it brings maintenance responsibility as well.

    If you have other suggestions for walkthroughs, we will be happy to hear.

    Thanks.

  • User Avatar
    0
    mdonogma created

    that would be really great.

    using mvc + jquery.

    I'm starting to make good progress with your platform and more impressed each day.

    a sample to help do file upload + update custom fields would help me close a big gap.

    Simple scenario: User enter a. Firstname (field1) b. Surname (field 2) 1 x File (example: copy of document or photo).

    appreciate it.

  • User Avatar
    0
    mdonogma created

    Any progress on basic example code for this?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @Mdonogma,

    I'm trying to prepare it. I will probably send it today.

    Thanks.

  • User Avatar
    0
    mdonogma created

    Awesome. Will really help me move forward

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    When I checked the file upload on profile picture update section, it seems like it is easy to add new fields. I forgot this section because we didn't change it recently.

    As you can see, we already send some fields here <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero/blob/master/src/MyCompanyName.AbpZeroTemplate.Web/Areas/Mpa/Views/Profile/_ChangePictureModal.js#L87">https://github.com/aspnetzero/aspnet-ze ... dal.js#L87</a>

    You can add fields to client side requet here and also you need to add those fields to your server side input class which is used here <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero/blob/master/src/MyCompanyName.AbpZeroTemplate.Application/Authorization/Users/Profile/ProfileAppService.cs#L85">https://github.com/aspnetzero/aspnet-ze ... ice.cs#L85</a>

    This should work without any other change. If this does not work we will help you to make it work.

    Thanks.

  • User Avatar
    0
    mdonogma created

    Ok

  • User Avatar
    0
    mdonogma created

    In your phonebook example it uses dynamic code to setup the client side JavaScript. Explain in the walk through . How am I supposed to use the picture upload code with the dynamic code.

    Need a pattern that aligns with your phonebook example else it is pointless.

    The phonebook walk through I'm assuming is how you recommend developers user your platform.

    The code sent doesn't resolve the problem as it uses a different pattern.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @Mdonogma,

    As you know AspNet Zero is a base solution and it comes with ready to use pages and it has a strong code base. But it cannot solve all web problems :), since you have the source code, you can develop your application as you like.

    AspNet Zero does not offer any built in file upload feature but it has a file upload with extra fields example, we cannot provide you any other example at the moment.

    I didn't understand why you don't want to use this approach. Maybe I didn't understand your case very well.

    Thanks.

  • User Avatar
    0
    fguo created

    My situation is very similar to this topic. I searched on forum and read your code on GitHub, but still not clear.

    I am using "ASP.NET Core & Angular2 v4.0". My case is almost same as your "phone book" example. The only difference is that I need a "Photo" property beside the "Name", "Surname", and "Email". The "Photo" is a jpg file with its file-name. The photo file should be saved in web server and the file name should be saved in database (like the Surname does).

    This is a popular scenario in enterprise application. If you can modify the "phone book" example by adding a "Photo" property, many members will appreciate it a lot, I think.

    Thanks,

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    As you know, in AspNet Zero users can change profile pictures from a different modal window. In your case, you can first upload image with a request and get it's id (id of binaryobject entity), then you can send this if with your second request in saving your main entity. We do it like that in AspNet Zero.

    We will definitely consider preparing detailed examples in the near future.

    Thanks.

  • User Avatar
    0
    dparizek created

    +1 for detailed example. In the UI-Demo0-Components section there is great UI for multi-file upload but that demonstration does not work for actual uploading. Is it supposed to work with ng2-file-upload?

  • User Avatar
    1
    dparizek created

    Actually I will make an example and write it up. I think (-: