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

鸿蒙4.0的系统 文件没有权限访问 #104

Open
fbu11 opened this issue Apr 24, 2024 · 6 comments
Open

鸿蒙4.0的系统 文件没有权限访问 #104

fbu11 opened this issue Apr 24, 2024 · 6 comments

Comments

@fbu11
Copy link

fbu11 commented Apr 24, 2024

微信截图_20240424104323
文件能选,但要用okhttp上传时报错
read failed: ENOTCONN
sdk用的是最新版

@javakam
Copy link
Owner

javakam commented Apr 26, 2024

看下怎么上传的, 来点代码

@fbu11
Copy link
Author

fbu11 commented Apr 27, 2024

很基础的okthhp上传代码,几百KB的文件都不需要切片
okHttpClient.newCall(
Request.Builder().url(Urls.UPLOAD_SINGLE).post(
MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("file", file.name, file.asRequestBody(MEDIA_TYPE_OCTET))
.build()
).build()
).enqueue(object : Callback {
override fun onFailure(call: Call, e: IOException) = dealException(e, callback)

        @Throws(IOException::class)
        override fun onResponse(call: Call, response: Response) = dealResponse(
            response, hasToken = false, callback = callback
        )
    })

@javakam
Copy link
Owner

javakam commented May 6, 2024

😅这是okhttp使用上的问题, 你再研究研究。AI是这么解答的你可以试试 :

image

@fbu11
Copy link
Author

fbu11 commented May 7, 2024

不是😅,这问题只在鸿蒙HarmonyOS 4.0 4.2的系统出现,其它手机Android13、Android14、HarmonyOS3.0、HarmonyOS2.0都没事

@fbu11
Copy link
Author

fbu11 commented May 7, 2024

AI就是屎

@fbu11
Copy link
Author

fbu11 commented May 7, 2024

鸿蒙也是屎,想让开发者开发,又不完全开放平台API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants