Hi everyone, Good morning
I got a error when I try to upload a pic using dropbox
This is image path that I give: "C:\Users\ADITYA\Downloads\imagetest.jpg"
This is error that I get :
Image file not found at the specified path: C:/Users/ADITYA/Downloads/imagetest.jpg
Reason:
Snap failed unexpectedly and did not provide any reason
This is code for operation :
case UPLOAD_PICTURE:
String pathToImageFile = "C:/Users/ADITYA/Downloads/imagetest.jpg";
String fileName = "imagetest.jpg";
String dropboxPath = "/apps/imagetest.jpg"; // Change this to the path you desire in Dropbox
try {
Path imagePath = Paths.get(pathToImageFile);
if (Files.exists(imagePath)) {
try (InputStream in = new FileInputStream(pathToImageFile)) {
FileMetadata metadata = client.files().uploadBuilder(dropboxPath)
.uploadAndFinish(in);
outputViews.write(documentUtility.newDocument(metadata));
}
} else {
throw new RuntimeException("Image file not found at the specified path: " + pathToImageFile);
}
} catch (IOException | DbxException e) {
throw new RuntimeException(e);
}
break;
Please help me to resolve the problem