Solved

copy file

Posted on 2004-04-24
13
196 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
 
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
For cloud, the “train has left the station” and in the Microsoft ERP & CRM world, that means the next generation of enterprise software from Microsoft is here: Dynamics 365 is Microsoft’s new integrated business solution that unifies CRM and ERP fun…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now