Reputation: 403
I trying to access this file \192.168.1.1\d$\IISFolders\ftp\teste.png in my network to get his bytes and put in a json file and send. But to access this directory I need Authenticate..
json.replace( a.getImage()/*string no ads.getimage()*/,
new Base64Encode( "//192.168.1.1//d$//IISFolders//ftp//"+a.getImage() ).encode()/*base64 string image*/ );
/* The encode code - already tested works fine */
public String encode() throws IOException
{
byte[] bytes = new byte[ 2048 ];
byte[] result = new byte[ (int) target.length() ];
int ibytes;
int counter = 0;
while( ( ibytes = bis.read(bytes) ) != -1 ) /* Read from buffIn */
{
System.arraycopy(bytes, 0, result, counter, ibytes);
counter += ibytes;
}
return new String( Base64.encodeBase64( result ) );
}
When I run the code the application couldn't find the file... throwing java.io.FileNotFoundException: \\192.168.1.1\d$\IISFolders\ftp\teste.png
and (Username and/or password are wrong)...
How could I access this directory and his files?
Upvotes: 0
Views: 956