Hi,
I'm trying to make midgard (beta 4) to serve blobs with articles.
I added the following code at the end of Admin-root/topic/article,
the blobs uploads perfect in /home/httpd/blobs and they are listed on
the page.
The problem is that the images suddenly stoped to show on the page, yes
they did show up at first.
What did I do wrong???
<?php
if ($article AND !$action){
if($delete_blob){
$article->deleteAttachment($delete_blob);
}
if($add_file && $userfile) {
$article->createAttachment($userfile_name,$title,$userfile_type);
$fa=$article->openAttachment($userfile_name);
$fu=fopen($userfile,"r");
while(fwrite($fa,fread($fu,$userfile_size))==$userfile_size);
fclose($fu);
fclose($fa);
?>
&(userfile_name); added !<br>
<?php
}
?>
<FORM ENCTYPE="multipart/form-data" ACTION="&(midgard.uri);"
METHOD=POST>
<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="1000000">
Add a file:<br><INPUT NAME="userfile" TYPE="file"><br>
Entitle this file:<br><INPUT NAME="title" TYPE="text"><br>
<INPUT TYPE="submit" NAME="add_file" VALUE=" A d d ">
</FORM>
<?php
$blobs=$article->listAttachments();
if ($blobs) {echo "Blobs: $blobs->N<br>";}
while($blobs && $blobs->fetch())
{
?>
<img src="&(blobs.name);" alt="&(blobs.title);"><br>
&(blobs.mimetype);<br>
[&(blobs.id);] &(blobs.name);<br>
<a
href="&(mgdroot);/topic/article/&(article.id);.html?delete_blob=&(blobs.name);"
class="navi">&(mgddel:h); Delete</a><br><br>
<?php
}
}
?>
Regards
/Skallen
--
________________________________________________________________________
Eat one live frog the first thing in the morning and nothing worse will
happen to either of you for the rest of the day.
________________________________________________________________________
Anders Karlsson - System Administrator
Digital Future AB, Norra Kungsgatan 8, S-371 33 Karlskrona, Sweden
E-Mail: [EMAIL PROTECTED] ICQ: 877 896
Phone: +46 455 151 09, Fax +46 455 194 62, Mobile +46 708 146 175
begin:vcard
n:Karlsson;Anders
tel;cell:+46 708 14 61 75
tel;fax:+46 455 194 62
tel;work:+46 455 151 09
x-mozilla-html:FALSE
url:http://cityguide.se/
org:Digital Future AB;----
adr:;;Norra Kungsgatan 8;Karlskrona;;371 33;Sweden
version:2.1
email;internet:[EMAIL PROTECTED]
title:<img src="http://193.15.110.110/images/DFCard.jpg">
x-mozilla-cpt:;-5664
fn:Anders Karlsson
end:vcard
--
This is The Midgard Project's mailing list. For more information,
please visit the project's web site at http://www.midgard-project.org
To unsubscribe the list, send an empty email message to address
[EMAIL PROTECTED]