I need to upload an image to a folder in a remote server

D

Diego

Hi every body,

i have to send an immage to a remote server, but when i do run, i
didi't have console error or unsuccesful writing, but the image dosen't
appare in the folder....

tha file has this adress..

static String dest_source_folder =
"\\\\elmsrv-ese02\\ELMTEST-REPOSITORY\\ELM2\\WebSrv\\www\\app\\webroot\\img\\";

String dest = new String(dest_source_folder + "mio.jpg");

and i try to send with..

ImageIO.write(dest, "JPG", new File(destFile);

the run give me an error:

Exception in thread "main" java.net.MalformedURLException: no protocol:
\\elmsrv-ese02\ELMTEST-REPOSITORY\ELM2\WebSrv\www\app\webroot\img\mio.jpg

what i have ti do to send this immage to the correct adress? (i sure
need to insert user ad pass word)

thk..
 
B

Brandon McCombs

Diego said:
Hi every body,

i have to send an immage to a remote server, but when i do run, i
didi't have console error or unsuccesful writing, but the image dosen't
appare in the folder....

tha file has this adress..

static String dest_source_folder =
"\\\\elmsrv-ese02\\ELMTEST-REPOSITORY\\ELM2\\WebSrv\\www\\app\\webroot\\img\\";

String dest = new String(dest_source_folder + "mio.jpg");

and i try to send with..

ImageIO.write(dest, "JPG", new File(destFile);

the run give me an error:

Exception in thread "main" java.net.MalformedURLException: no protocol:
\\elmsrv-ese02\ELMTEST-REPOSITORY\ELM2\WebSrv\www\app\webroot\img\mio.jpg

what i have ti do to send this immage to the correct adress? (i sure
need to insert user ad pass word)

thk..

Well it seems that Java doesn't know how to use UNC path names and
therefore it can't write the file. You may need to open a socket and
send it "manually" unless you can use some other protocol such as ftp
that java understands. If you open a socket you'll need to write another
program that runs on the server that can receive your request from the
client.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top