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

S3 无法上传文件 #54

Open
loveqianool opened this issue Feb 20, 2023 · 7 comments
Open

S3 无法上传文件 #54

loveqianool opened this issue Feb 20, 2023 · 7 comments
Labels

Comments

@loveqianool
Copy link

我绑定了一个桶,可以正常下载,删除,重命名文件
在 Go-drive 内可以新建文件和文件夹,但是上传文件就会提示错误

@devld
Copy link
Owner

devld commented Feb 20, 2023

是 AWS S3 吗?是否勾选 上传代理

@loveqianool
Copy link
Author

是甲骨文,他家是可以直连的,我尝试勾选上传代理也是同样的问题。

@devld
Copy link
Owner

devld commented Feb 22, 2023

我现在还没办法测试甲骨文的,可否提供一些上传失败时出现的错误信息。

比如浏览器控制台中的信息,或者服务端的日志信息。

@loveqianool
Copy link
Author

Access to XMLHttpRequest at 'https://example.compat.objectstorage.ap-tokyo-1.oraclecloud.com/z/desktop.ini?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=example%2F20230222%2Fap-tokyo-1%2Fs3%2Faws4_request&X-Amz-Date=20230222T103903Z&X-Amz-Expires=7200&X-Amz-SignedHeaders=host&X-Amz-Signature=example' from origin 'https://godrive.example.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
index.a9c53c86.js:44 

PUT https://example.compat.objectstorage.ap-tokyo-1.oraclecloud.com/z/desktop.ini?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=example%2F20230222%2Fap-tokyo-1%2Fs3%2Faws4_request&X-Amz-Date=20230222T103903Z&X-Amz-Expires=7200&X-Amz-SignedHeaders=host&X-Amz-Signature=example net::ERR_FAILED
docker logs godrive
2023/02/22 10:38:30 Creating drive: Local
2023/02/22 10:38:30 Created drive: Local
2023/02/22 10:38:30 Creating drive: JP251
2023/02/22 10:38:31 Created drive: JP251
2023/02/22 10:38:31 Creating drive: OD_E5
2023/02/22 10:38:31 Created drive: OD_E5
2023/02/22 10:38:31 Creating drive: Gdrive
2023/02/22 10:38:31 Created drive: Gdrive
2023/02/22 10:38:31 Creating drive: JP201
2023/02/22 10:38:31 Created drive: JP201
2023/02/22 10:38:31 Creating drive: jp_s3
2023/02/22 10:38:35 Created drive: jp_s3
2023/02/22 10:38:35 Creating drive: teracloud
2023/02/22 10:38:35 Created drive: teracloud
2023/02/22 10:38:35 Reloading drives done.
2023/02/22 10:38:35 [i18n] 2 languages loaded: [en-US zh-CN]
2023/02/22 10:38:35 [i18n] default language: zh-CN
2023/02/22 10:38:35 Server started
[GIN] 2023/02/22 - 10:39:03 | 200 |   31.514952ms |      172.26.0.1 | POST     "/upload/jp_s3/desktop.ini?size=282"

@devld
Copy link
Owner

devld commented Feb 23, 2023

Access to XMLHttpRequest at 'https://example.compat.objectstorage.ap-tokyo-1.oraclecloud.com/z/desktop.ini?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=example%2F20230222%2Fap-tokyo-1%2Fs3%2Faws4_request&X-Amz-Date=20230222T103903Z&X-Amz-Expires=7200&X-Amz-SignedHeaders=host&X-Amz-Signature=example' from origin 'https://godrive.example.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
index.a9c53c86.js:44 

PUT https://example.compat.objectstorage.ap-tokyo-1.oraclecloud.com/z/desktop.ini?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=example%2F20230222%2Fap-tokyo-1%2Fs3%2Faws4_request&X-Amz-Date=20230222T103903Z&X-Amz-Expires=7200&X-Amz-SignedHeaders=host&X-Amz-Signature=example net::ERR_FAILED
docker logs godrive
2023/02/22 10:38:30 Creating drive: Local
2023/02/22 10:38:30 Created drive: Local
2023/02/22 10:38:30 Creating drive: JP251
2023/02/22 10:38:31 Created drive: JP251
2023/02/22 10:38:31 Creating drive: OD_E5
2023/02/22 10:38:31 Created drive: OD_E5
2023/02/22 10:38:31 Creating drive: Gdrive
2023/02/22 10:38:31 Created drive: Gdrive
2023/02/22 10:38:31 Creating drive: JP201
2023/02/22 10:38:31 Created drive: JP201
2023/02/22 10:38:31 Creating drive: jp_s3
2023/02/22 10:38:35 Created drive: jp_s3
2023/02/22 10:38:35 Creating drive: teracloud
2023/02/22 10:38:35 Created drive: teracloud
2023/02/22 10:38:35 Reloading drives done.
2023/02/22 10:38:35 [i18n] 2 languages loaded: [en-US zh-CN]
2023/02/22 10:38:35 [i18n] default language: zh-CN
2023/02/22 10:38:35 Server started
[GIN] 2023/02/22 - 10:39:03 | 200 |   31.514952ms |      172.26.0.1 | POST     "/upload/jp_s3/desktop.ini?size=282"

看样子是有跨域的问题,需要配置一下,可以参考 https://go-drive.top/#s3 配置一下

@loveqianool
Copy link
Author

https://www.oracle.com/cloud/storage/object-storage/faq/
The Oracle Cloud Infrastructure Object Storage API and Swift API do return Cross-Origin Resource Sharing (CORS) headers; however, the returned headers are fixed and cannot be edited. The Amazon S3 Compatibility API does not return CORS headers.

@devld
Copy link
Owner

devld commented Feb 23, 2023

这就没办法了,我看看后面支持一下这个。

@devld devld added the feature label Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

2 participants