Open Closed

Incorrect proxy generated for file upload API: Cannot find name 'StringValues'. #1174


User avatar
0
dev03 created
  • ABP Framework version: v4.0.2

  • UI type: Angular

  • DB provider: MongoDB

  • Tiered (MVC) or Identity Server Separated (Angular): yes

  • Exception message and stack trace:

  • Steps to reproduce the issue:

I tried to upload a file using IFormFile, but an error occurred when generating the proxy, See this:
image.png

Did I miss something? The API like this:
image.png
image.png

Found an issue on github: https://github.com/abpframework/abp/issues/6384


12 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi coeusli

    You should use IRemoteStreamContent in app service. Then follow https://github.com/abpframework/abp/issues/6384#issuecomment-739245736

  • User Avatar
    0
    dev02 created

    Using iRemoteStreamContent, according to the documentation, the following error occurs

    微信截图_20210412202934.png
    微信截图_20210412202837.png

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi dev02

    What is your angular code that call this method?

  • User Avatar
    0
    dev02 created

    微信图片_20210412212558.png
    微信图片_20210412212623.png

  • User Avatar
    0
    dev02 created

    Try the jQuery call, same error
    jquery.png

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    You need to pass the file in the request body before v4.3.

    example:

    var settings = {
      "url": "https://localhost:44362/api/upload-file",
      "method": "POST",
      "headers": {
        "Content-Type": "image/png"
      },
       "data": "<file contents here>"
    };
    
    $.ajax(settings).done(function (response) {
      console.log(response);
    });
    

    You can use FormData after v4.3.
    https://github.com/abpframework/abp/pull/8302

  • User Avatar
    0
    dev02 created

    How can Ajax Data pass arguments without using FormData?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    You can also copy code of PR to your project then you can use FormData .

  • User Avatar
    0
    ServiceBot created
    Support Team Automatic process manager

    This question has been automatically marked as stale because it has not had recent activity.

  • User Avatar
    0
    dev03 created

    ** ABP Framework version Upgrade to 4.4.3**

    image.png
    image.png
    image.png

    RemoteStreamContent wèishéme shì null?

  • User Avatar
    1
    maliming created
    Support Team Fullstack Developer

    Try to use same paramter name.

    image.png

  • User Avatar
    1
    dev03 created

    image.png

    This is fine, thank you.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-preview. Updated on April 11, 2025, 10:10