Solved

copy file

Posted on 2004-04-24
13
199 Views
Last Modified: 2010-04-01
Hi Experts,

I would copy input file using URL(for input only)  from one server to another ... How it can be done ?

Thank you.
0
Comment
Question by:fpoyavo
  • 7
  • 6
13 Comments
 
LVL 92

Expert Comment

by:objects
ID: 10910483
the server u are copying the file to would need to provide some means to copy files to it
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10910549
????? please explain
0
 
LVL 92

Expert Comment

by:objects
ID: 10910559
you cannot just copy a file to any server for obvious reasons.
Do you control the server you want to copy the file to?
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 1

Author Comment

by:fpoyavo
ID: 10910561
The problem I guess is that the file is PDF. Can it be copied ?
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10910563
Yes. Both servers are owned by my company.
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10910577
Can PDF file be read ? I guess it has to be some method or something just to copy without reading a content :( ???
0
 
LVL 92

Expert Comment

by:objects
ID: 10910582
> The problem I guess is that the file is PDF. Can it be copied ?

yes thats fine

> Yes. Both servers are owned by my company.

and where will the copy be performed from? ie. which machine
0
 
LVL 92

Expert Comment

by:objects
ID: 10910584
> I guess it has to be some method or something just to copy without reading a content :( ???

yes you'd just read the bytes and copy them directly.
0
 
LVL 92

Accepted Solution

by:
objects earned 500 total points
ID: 10910588
eg. if you were running on the server that you wanted to copy to it would be easy.

InputStream in = pdfurl.openStream();
OutputStream out = new BufferedOutputStream(new FileOutputStream(pdfname));
byte[] buf = new byte[1024];
int nread = 0;
while (-1!=(nread=in.read(buf)))
{
   out.write(buf, 0, nread);
}
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10910629
It say that file is damaged and cannot be repaired. ????
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10910632
It did write it to my temp dir but cannot be opened. ???
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 10910643
It is OK :))))))) YAHOOOO THANK YOU.
0
 
LVL 92

Expert Comment

by:objects
ID: 10910659
:)
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
dateFashion java challenge 9 141
equalIsNot  challenge 43 144
Java Script nested call 3 86
web application structure 18 77
This tutorial shows how to create a greeting card by combining two image layers and a text layer on a PC using a free image editing app.
Read about the importance of offline branding in the digital age.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question