Solved

copy file

Posted on 2004-04-24
13
198 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem with Pie chart in Jsp 20 206
Converting a Hibernate Query to use parameters 5 105
JSP Popup page 2 107
struts spring hibernate example 12 108
A customer recently asked me about anti-malware and the different deployment options available for his business. Daily news about cyberattacks, zero-day vulnerabilities, and companies that suffered a security breach made him wonder if the endpoint a…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

895 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

13 Experts available now in Live!

Get 1:1 Help Now