cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

TFTP PUT in PHP

From: Mino Bernardi <giacomino_at_gmail.com>
Date: Fri, 26 Oct 2007 03:35:28 +0100

Hello to everyone,
I've been using libcurl in PHP for a while, but now I'd need to
perform TFTP PUT with it.

I've looked for documentation, googled and scanned the source code in
lib/tftp.c to understand which option variables I should set in order
to specify source and destination filenames...

I'm trying to do something like this:

<?
$c = curl_init("tftp://1.1.1.1/destinationfilename.bin");

curl_setopt($c, "CURLOPT_BINARYTRANSFER", "TRUE");
curl_setopt($c, "CURLOPT_PUT", "TRUE");
curl_setopt($c, "CURLOPT_INFILE", "sourcefilename.bin");
curl_setopt($c, "CURLOPT_INFILESIZE", filesize("sourcefilename.bin"));

curl_exec($c);
curl_close($c);
?>

I supposed that the tftp would have used the _INFILE and _INFILESIZE
variables but I must be wrong, as I'm getting errors like "TFTP: File
Not Found".

How should I work this out?
Many thanks!
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2007-10-26