Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

copy file

Posted on 2004-04-24
13
Medium Priority
?
205 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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 2000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

What monsters are hiding in your child's room? In this article I will share with you a tech horror story that could happen to anyone, along with some tips on how you can prevent it from happening to you.
As much as Microsoft wants to kill off PST file support, just as they tried to do with public folders, there are still times when it is useful or downright necessary to export Exchange mailboxes to PST files. Thankfully, it is still possible to e…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

618 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