473,387 Members | 1,721 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,387 software developers and data experts.

cURL - copy image file from one server to another

i would need help with creating some cURL code...

$old_file = "http://my_host.com/images/test.jpg";
$new_destination = "http://some_other_host.com/archived_images";

i was trying to create a cURL code that would copy the $old_file to a $new_destination but did not have much success...
basicaly i need to copy the file to the new server and if succedded, delete the original on old server

can somebody give me a hint with this?
Oct 26 '06 #1
1 4284
Rik
friglob wrote:
i would need help with creating some cURL code...

$old_file = "http://my_host.com/images/test.jpg";
$new_destination = "http://some_other_host.com/archived_images";

i was trying to create a cURL code that would copy the $old_file to a
$new_destination but did not have much success... basicaly i need to
copy the file to the new server and if succedded, delete the original
on old server
It would be a hell of a lot easier if you do it by FTP rather then cURL.
How do you propose you can delete a file by HTTP, or store (yes, PUT, very
rare)?
--
Rik Wasmus
Oct 26 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Chris Fortune | last post by:
# uname -a Linux stargate.mxc-online.net 2.4.20-021stab022.2.777-smp #1 SMP Wed Jul 28 17:12:37 MSD 2004 i686 i686 i386 GNU/Linux I recompiled PHP with mcrypt, openssl, and curl phpinfo():...
0
by: Chuck Anderson | last post by:
I am writing a Php script to run on my home PC (Windows) that downloads an Apache access log file and inserts new entries into a database.. The only way I can access these log files is through a...
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...
2
by: lookee | last post by:
Hello all, I have simple PHP application that on one page strarts session and write some information to it. On another page program tryes to fetch information from a third page using cURL. On that...
0
by: xerc | last post by:
I am trying to create a generic function I can call to download all files from a single remote FTP directory -- using CURL. I want to multi-thread it, but need to get the single thread functionality...
4
by: herbivore | last post by:
I am using curl to do a post request to a server. The request contains xml data, the standard post headers sent by curl do not work. I have tried using the custom_request option with the whole post...
1
by: nothing1 | last post by:
I'm getting some warning using the code below: Error: failed to open stream: Permission denied in Code: function wwwcopy($url,$dirname){ $file = fopen($url, "r"); if (!$file) { ...
2
by: Sav | last post by:
I'm using curl to scrape an image file from an external server (see code below). Is there any way to determine the external image file's modified date? Ideally, I'd like to only process the image...
11
by: Flexor | last post by:
I have a php script that runs from command line and makes an https request to paypal, using curl. It works fine if I run it from a web page. It fails if I run it from CLI. The error I get from...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.