473,322 Members | 1,431 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Copy a file from one server to another

22
If the permissions are set to 777 of all files and all directories. Is there a possible way to do it without having to download it and upload it again? I don't expect this to work on PHP files. I'm thinking .exe files, etc...

I've tried using fopen() and fread() and also file_get_contents().
Neither of which worked to get the file, although, oddly, didn't return an error.

If anyone knows about this can you please let me know?

Thanks
~Tyler
Jul 18 '07 #1
5 3067
tscott
22
I was going to edit my post and say that I don't have FTP access to this server. Although I want to use this to legally get a file and transfer it to my server without having to download and upload it. I've searched google and everywhere. Can't find a tutorial. Maybe there is a way to do it via CURL?
Jul 19 '07 #2
pbmods
5,821 Expert 4TB
Heya, tscott.

What kinds of files are these? If they are PHP files, you won't be able to fetch them via cURL nor using file_get_contents() because the remote server will evaluate any scripts that you try to fetch via HTTP.
Jul 19 '07 #3
tscott
22
I said they weren't PHP files, I meant for an example an *.exe file or a *.html file.

A file that any user could download and upload.
All I end up with is a blank file.

Is that possible.
Jul 19 '07 #4
pbmods
5,821 Expert 4TB
Heya, Tyler.

Hm.

The easiest thing to do would be to download them and then upload them again. Not a whole lot of fun, but when's the last time you backed up all your server's files anyway?

In terms of "no error, no content", note that file_get_contents() and fread() generate errors of E_NOTICE severity when they encounter HTTP errors (e.g., 404 not found). Most developers turn off these errors because they are non-critical and generally annoying.


[EDIT: Though I never said that most developers SHOULD do this... nudge, nudge.]
Jul 22 '07 #5
kovik
1,044 Expert 1GB
Servers can control everything that you do while on the server. You may be downloading from a server that doesn't allow external referrers to access their content.

Try simply loading their file as a part of a page using cURL, and turn on the header display so you can see if you have access or not.
Jul 22 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Khue Pham | last post by:
Does anyone knows how to copy database from one server to another. By copying I mean literally everything, not just the database. I know we can dump the database from one server then reload it to...
1
by: John Finch | last post by:
We are running SQL 7 on a Windows NT Server. If you copy a 25Mb file from this machine to a W2K server, the file copy takes over 5 minutes on a 100Mpbs switched network. Copying the same file to...
1
by: POnfri | last post by:
Hi, I have a problem in a peace of code were i'm doing a file copy using File.Copy. The Source is local and the target is a remote machine. Example: File.Copy(C:\temp\hi.txt,...
2
by: Stephen Witter | last post by:
I had previously posted this on the security ng, but haven't had a hit so I was wondering if someone here would be willing to take a stab. I am trying to copy a file to a network drive. I can do...
8
by: Chris Strobel | last post by:
I have 2 web servers where I need to write a PDF file and need to keep them in sync. In others words, If the Server1 is getting called to create the PDF, then it needs to copy the PDF to the other...
3
by: Johnny | last post by:
Hi, I have created an ASP.NET application (let's call it FooBar) with VS.NET on my local machine, residing in http://localhost/FooBar. Deploying it to another folder on my machine works well...
3
by: Shailesh Gajare | last post by:
Hi All, I have creating an ASP.Net application with two web servers. I am uploading a file which is being uploaded on one of the server, I want to copy the uploaded file on the other server at the...
7
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
6
by: RitaG | last post by:
Hello. I have a VB.Net program that copies a file from one server to another server. This program has been working without any problems for about a year. A couple of weeks ago the "server from"...
9
by: fniles | last post by:
I would like to copy a table(s) from SQL Server 2005 to a CVS file and vice versa. I was thinking to use the BCP command line utility, but I have a few questions: 1. The machine where I am...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.