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

open failed: ENOENT (No such file or directory) #78

Open
erizoo opened this issue Oct 21, 2022 · 4 comments
Open

open failed: ENOENT (No such file or directory) #78

erizoo opened this issue Oct 21, 2022 · 4 comments
Assignees
Labels
question Further information is requested

Comments

@erizoo
Copy link

erizoo commented Oct 21, 2022

Hi, I try save result uri to file, that upload to server, but i get this error to upload "open failed: ENOENT (No such file or directory)"

@Drjacky Drjacky self-assigned this Oct 21, 2022
@Drjacky
Copy link
Owner

Drjacky commented Oct 21, 2022

Can you add your code snippet?

Also, when you use the URI to display the image locally, does it work correctly?

@Drjacky Drjacky added the question Further information is requested label Oct 21, 2022
@nishkul
Copy link

nishkul commented Oct 30, 2022

even for me issue is the same

            var file = File(userProfileUrl.toString())
            val reqFile = file.asRequestBody("application/image".toMediaTypeOrNull())
            val imageBody = MultipartBody.Part.createFormData("image", file.name,reqFile)

@Drjacky
Copy link
Owner

Drjacky commented Dec 19, 2022

Please try I this new version: 2.3.21 and let me know if it fixed the issue or not

@Jimit-speed
Copy link

Jimit-speed commented Apr 4, 2024

@Drjacky
I am facing the same issue and using the latest version of this SDK.

Here is my snippet which I integrated.

ImagePicker.with(this)
            .galleryOnly()
            .galleryMimeTypes(
                arrayOf(
                    Constants.MIMETypes.IMAGE_PNG,
                    Constants.MIMETypes.IMAGE_JPEG,
                    Constants.MIMETypes.IMAGE_JPG,
                ),
            )
            .createIntent()
            .also {
                selectImageCropResultLauncher?.launch(it)
            }

Uri: content://media/picker_get_content/0/com.android.providers.media.photopicker/media/1000154898

File path Data -> /sdcard/.transforms/synthetic/picker_get_content/0/com.android.providers.media.photopicker/media/1000154898.jpg

use this method to upload a file to the server.

val multipartBody = MultipartBody.Part.createFormData(
            name = "file",
            filename = imageFile.getName(),
            body = imageFile.asRequestBody(contentType = "image/*".toMediaType()),
        )

Please help to fix this issue.

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

No branches or pull requests

4 participants