on 04-27-2007 5:58 PM
Hi All,
I have uploaded file to the server in C:
temp folder.
Now I want to get the file path(c:\temp\test.doc) in URL format.
How do I get this?
Thanks
Sundar
use this kind of coding
URL url1 = new URL("http://localhost:8000/servapp/websites.html");
URLConnection ucon1 = url1.openConnection();
System.out.println(ucon1.getContentLength());
Object obj1 = ucon1.getContent();
System.out.println(obj1.getClass());
InputStream is = (InputStream)obj1;
byte b[] = new byte[10000];
int i = is.read(b,0,ucon1.getContentLength());
File f=new File("E:
htmlfiledown.html");
FileOutputStream fos=new FileOutputStream(f);
BufferedOutputStream bos=new BufferedOutputStream(fos);
int data;
for(int i1=0;i1<=ucon1.getContentLength()1024;i1+)
{
bos.write((char)b[i1]);
}
}catch(Exception e)
{
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try thes steps.hope this will help u.
File doc = new File("x/y/z.doc");
doc.getURL();
Regards,
Lavanya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
take a look at these,
File file = new File("text.txt");
String str = file.getAbsolutePath();
hope it helps
regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.