Martin Hierling wrote:

> $article=mgd_get_article($argv[0]);
>
> if ($userfile) {
>       echo $userfile."<br>";
>       echo $userfile_name."<br>";
>       echo $userfile_size."<br>";
>       echo $userfile_type."<br>";
>       echo "<hr>";
>       $att = $article->createattachment("$userfile_name","$userfile_name", 
>"$userfile_type");

   $tgt = mgd_open_attachment($att, "w");
   $src = fopen($userfile, "r");

   while ($data = fread ($src, 1024)) { fwrite($tgt, $data); }

   fclose($src);
   fclose($tgt);

>       }
>
> So, but what now, how do I get file /tmp/ikUhionjk3 ($userfile) into the
> attachment. I need some code f�r the xxxxx section ;-) or some useful
> example.

But please go read the warnings at
http://www.php.net/manual/en/function.fwrite.php. For some -- to me,
utterly incomprehinsible -- reason, if you have magic_qoutes enabled,
these are written to the target file. Ehm, ooookaaaay. That makes sense
in somebodies universe, I guess.

Once we have the scripting layer it'll be easy (and very useful) to add
methods to simply copy over the file in one go instead of having to do
read-write.

Alexander? ETA on the php4-scripting extension and some sample code?

Emile



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to