Solved

copy file

Posted on 2004-04-24
13
203 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

There is a lot to be said for protecting yourself and your accounts with 2 factor authentication.  I found to my own chagrin, that there is a big downside as well.
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

707 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