Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translation: AccessServer Handler cannot upload files. #3037

Closed
bogerj opened this issue Nov 7, 2023 · 5 comments
Closed

Translation: AccessServer Handler cannot upload files. #3037

bogerj opened this issue Nov 7, 2023 · 5 comments
Labels
Bug Something isn't working External Issue Not a Wails issue but something wrong with an external dependency Upstream Issue

Comments

@bogerj
Copy link

bogerj commented Nov 7, 2023

Description

I used the AccessServer's handler to receive requests from the frontend, but I found that the ContentLength of the received POST request is always 0, and there is no data in the body either.

前端通过 表单上传了一个文件,但是后台无法接受文件

To Reproduce

I created a form in the frontend to upload files, but the backend is not receiving the files.

前端通过 表单上传了一个文件,但是后台无法接受文件

Expected behaviour

can upload file

能上传文件

Screenshots

image

Attempted Fixes

No response

System Details

# System                          
                                  
OS           | Windows 10 Pro     
Version      | 2009 (Build: 19045)
ID           | 22H2               
Go Version   | go1.20.1           
WebView2   | N/A          | Installed | 116.0.1938.76
Nodejs     | N/A          | Installed | 14.17.2
npm        | N/A          | Installed | 6.14.13
*upx       | N/A          | Available |
*nsis      | N/A          | Available |
* - Optional Dependency

# Diagnosis

Your system is ready for Wails development!
Optional package(s) installation details:
  - upx : Available at https://upx.github.io/
  - nsis : More info at https://wails.io/docs/guides/windows-installer/

Additional context

No response

@bogerj bogerj added the Bug Something isn't working label Nov 7, 2023
@bogerj bogerj changed the title Translation: AccessServer cannot upload files. Translation: AccessServer Handler cannot upload files. Nov 7, 2023
@bogerj
Copy link
Author

bogerj commented Nov 7, 2023

assetServer config

AssetServer: &assetserver.Options{
Assets: assets,
Handler: httpProxy.NewFileLoader(),
},

@stffabi
Copy link
Collaborator

stffabi commented Nov 7, 2023

Thanks for using Wails and reporting this issue.

Unfortunately this is a WebView2 issue with multi-part POST data, and beyond our control. Please see the tracking issue on the webview2feeeback repo: MicrosoftEdge/WebView2Feedback#2162

@stffabi stffabi added the External Issue Not a Wails issue but something wrong with an external dependency label Nov 7, 2023
@bogerj
Copy link
Author

bogerj commented Nov 7, 2023

May I ask , if there are any other ways to achieve the function of uploading files from web pages to specific interfaces

@leaanthony
Copy link
Member

Use Go to do the job. We don't recommend using JS for anything other than view.

@bogerj
Copy link
Author

bogerj commented Nov 7, 2023

谢谢,我明白了,我在尝试下其他方法

@bogerj bogerj closed this as completed Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working External Issue Not a Wails issue but something wrong with an external dependency Upstream Issue
Projects
None yet
Development

No branches or pull requests

3 participants