> Hi!
>
> I made this:
> $article = mgd_get_article($id);
> $att =
> $article->createattachment("$article->name","$article->title","");
>
> I'd like attachment to has tha same name as article name.
No problem.
> Is mime type important?
Only if you use serveattachment, as it sends out the mimetype in the
headers. If you send it with the wrong, or no, mimetype, things will
probabl still work for <IMG> objects since many browsers seem to ignore the
mimetype in that case.
> And how to get mime type?
After an HTTP file upload it will be present in <filefield>_type.
> $fh = $article->openattachment($article->name,"w"); # and the
> attachment too. fputs($fh, "$article->name");
> fclose($fh);
This clears the blob and overwrites the contents with the article name.
> I should use serve here but I do not understand why use serve and exit
> in the middle of a page.
It's no use calling serve in the middle of the page. You probably want to
call serve & exit from code-init.
> There are attachments records added to blobs
> table , but all 'files' are 0kb i blobs directory.
*grin* The "w" above could explain that.
> And what is the proper url for all $object->attachment.
Unless it's a page attachment, there's no canonical URL for it. You'll need
to call serve.
> If there is any manual in clear form for this topic , just tell me.
I'm a frayed knot.
Emile
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]