Thank you for submitting your inquiry.
You can track the status of your inquiry here.
You may want to save your case's ticket: 826626_htlchp13nh8th2to


    (Closed) UnityWebRequest and Multipart content bug
     
     
     
    5
    UnityWebRequest and Multipart content bug

    1. What happened

    When I make a POST request with "IMultipartFormSection" with both data and files it sends it with and incorrect Content-Type header and body it's messed up.

    Content-Type should be "multipart/form-data" instead of "application/x-www-form-urlencoded".

    Tested on Editor and Windows Standalone but it seems that it's a bug on all platforms.

    It's also applicable to Unity 5.3.x branch because it happens on 5.3.6 also so it doesn't seem like a regression.

    2. How we can reproduce it using the example you attached

    a. Upload "test.php" and "test.html" script somewhere.
    b. Open "test.html" file and edit "form" action attribute to point to your host.
    c. Open "test.html" in a browser, fill the two "file" input values and press submit.
    d. Your should see a "request.log" file in the same folder as the "test.php" script. Watch the output that it's splitted in three sections: header, post data and files.
    e. Open in Unity "test" scene and edit in inspector the "uri" field to point to your host.
    f. Press "Play".
    g. Open "request.log" again and you should see the error: Content-Type incorrectly set and request body is messed up mixing form data and files.

    I hope that with this detailed information you should be able to fix it really fast in a patch release.

    License type: Pro
     
       
      To follow up on this case, send email to bugs@unity3d.com mentioning 'Case 826626' in the subject.
      Your Cases:
      Case Title Status Date Opened
      1408030 Regression of Microsoft.Extensions.DependencyInjection with WebGL Closed 3/2/2022 5:54 PM
      1373389 Can't build for UWP using .NET Standard 2.1 packages Closed 10/15/2021 7:14 PM
      1373388 Plugin duplicity when building for Android platform Open 10/15/2021 7:06 PM
      1362350 It's not possible to satisfy an asmdef define constraint using a global csc.rsp file Closed 9/1/2021 10:52 PM
      1334636 Not adding NET_STANDARD_2_0 define on UWP platform Closed 5/7/2021 10:49 PM
      1318152 Can't build with IL2CPP on Windows 64bits Closed 2/28/2021 8:07 PM
      1307810 Assembly Version Validation disabled with IL2CPP Closed 1/20/2021 6:48 PM
      1291694 Using Unity Hub cli install command sometimes does not register installation on UI and fails on install-modules command Closed 11/10/2020 4:11 PM
      1291688 Unity Hub cli commands return exit code 1 Closed 11/10/2020 4:02 PM
      1251130 [WebGL] [IL2CPP] WebGL builds fail with UnityLinker.exe error Closed 5/28/2020 10:08 AM
      1243074 Crash on WebGL: To use dlopen, you need to use Emscripten's linking support Open 4/30/2020 9:59 PM
      1241238 Fatal error in Unity CIL Linker System.NullReferenceException: Object reference not set to an instance building to WebGL Closed 4/24/2020 5:14 PM
      1241237 Fatal error in Unity CIL Linker System.NullReferenceException: Object reference not set to an instance building to WebGL Closed 4/24/2020 5:10 PM
      1240413 SecurityException only on IL2CPP and not Mono Closed 4/22/2020 9:43 AM
      1223602 IPostprocessBuildWithReport doesn't get called if the result is Failed Closed 2/28/2020 8:44 AM
      1223601 BuildReport always triggers Unknown result despite being a correct build Closed 2/28/2020 8:34 AM
      1208398 Can't build for UWP if playmode tests for all assemblies is enabled Closed 12/30/2019 11:19 PM
      1196416 Assembly dependency resolution bug depending on folder hierarchy Closed 11/5/2019 5:46 PM
      1193928 Compilation error with .NET Standard 2.0 assemblies depending on folder hierarchy Closed 10/24/2019 11:15 PM
      1190542 UWP ContentDialog allows to click on Unity selectable objects that are behind Closed 10/10/2019 6:11 PM
      1190321 Instantiating a native UWP WebView crashes Closed 10/9/2019 11:16 PM
      1104540 UWP Control and inheritance crash Closed 11/27/2018 6:10 PM
      1089608 .NET Standard and Microsoft.Win32.Registry conflict Editor / Runtime Closed 10/10/2018 10:50 PM
      1066748 SecurityException only on IL2CPP and not Mono Closed 8/2/2018 6:20 PM
      1066732 FileSystemWatcher not implemented on .NET 4.x with .NET Standard 2.0 only Closed 8/2/2018 5:50 PM
      1037523 Regression recreating Visual studio solution files Closed 5/13/2018 8:50 PM
      1001868 Unloading broken assembly *, this assembly can cause crashes in the runtime Closed 2/13/2018 7:30 PM
      1001101 Test Runner doesn't work when running from an assembly Closed 2/11/2018 7:40 PM
      987611 Huge regression on compilation time Closed 1/13/2018 7:50 PM
      987608 Huge test runner performance regression Closed 1/13/2018 7:40 PM
      987600 Can't run any test with test runner Closed 1/13/2018 7:20 PM
      987590 Running test runner from root element doesn't run or doesn't mark each test state Closed 1/13/2018 6:30 PM
      987587 Test runner hierarchy doesn't correctly select an item Closed 1/13/2018 6:30 PM
      982077 A$ Submission 107893: Moodle API Closed 12/26/2017 6:24 PM
      908464 Command line exportPackage always crashes on macOS Closed 5/6/2017 5:40 PM
      904373 Regresion with WebGL template parameters not being replaced Closed 4/23/2017 4:00 PM
      900754 Empty command line logFile parameter does redirect to standard output on OS X but not on Windows Closed 4/12/2017 12:20 AM
      899680 VideoPlayer Prepare method broken Closed 4/8/2017 4:30 PM
      899667 Regression compiler errors when building from command line and removing not used script Closed 4/8/2017 4:00 PM
      899652 Build and Run incorrectly continues and pushes an old APK if build fails Closed 4/8/2017 3:20 PM
      893805 Test Runner batchmode NUnit XML does not have PlayMode test results Closed 3/22/2017 9:50 AM
      893804 Test Runner batchmode NUnit XML format is not well formed Closed 3/22/2017 9:50 AM
      892798 Regression running tests with batch mode Closed 3/19/2017 3:50 PM
      887036 UWP marshalling exception when using WebView class Closed 3/3/2017 4:20 PM
      882064 Editor hangs via command line build with System.IO.IOException: Sharing violation on path Closed 2/17/2017 10:10 AM
      880381 Android VideoPlayer and content resolver url error Closed 2/12/2017 2:20 PM
      879050 uGUI Button component and event propagation error Closed 2/8/2017 12:30 PM
      879044 AssetDatabase.LoadAssetAtPath<T> error deserializing Closed 2/8/2017 12:20 PM
      878218 Editor via command line freeze/crash when building Closed 2/6/2017 9:30 AM
      877910 Command line -buildTarget there is no value for StandaloneOSXIntel64 Closed 2/5/2017 2:40 AM
      877569 Can't compile projects that have an editor test (edit mode or play mode Closed 2/3/2017 9:20 PM
      876406 Regression with RectTransform and NaN values with ScrollRect Closed 1/31/2017 8:40 PM
      875057 Custom global defines with mcs.rsp file aren't available in Visual Studio and compilation fails Closed 1/27/2017 4:21 PM
      871451 VideoPlayer texture freezes on seek Closed 1/17/2017 9:20 PM
      850877 Command line arguments -buildTarget parameter missing osx64 and osxUniversal values Closed 11/13/2016 4:40 PM
      850673 Editor Command line argument -buildTarget crashes entire Editor Closed 11/12/2016 6:10 PM
      849188 WebGL Uncaught RangeError Closed 11/7/2016 8:30 PM
      848830 BuildPipeline.BuildPlayer throws DirectoryNotFoundException on specific platforms Closed 11/6/2016 8:00 PM
      846086 WebGL build Uncaught RangeError: Source is too large Closed 10/28/2016 12:20 PM
      837009 Can't compile some System.Net classes Closed 10/1/2016 10:20 AM
      832379 When publishing a project .svn folders are been copied Open 9/16/2016 10:40 AM
      826835 A$ Submission 69513: Drupal API Closed 8/28/2016 1:17 PM
      826626 UnityWebRequest and Multipart content bug Closed 8/27/2016 1:01 PM
      791260 [InitializeOnLoad] script using AssetDatabase.IsValidFolder returns false on "Reimport All Closed 4/24/2016 1:39 PM
      781256 A$ Submission 58729: Super Sensor Closed 3/20/2016 12:06 PM
      771816 Custom font wrong vertical alignment on text component Closed 2/18/2016 12:04 PM
      763150 A$ Submission 53523: Scorm API Closed 1/20/2016 1:52 AM
      758627 A$ Submission 52968: Instagram API Closed 1/2/2016 3:35 PM