On Fri, 26 May 2000, T. Wijnen wrote:

> Hi, I'm trying to make a simple upload form in html that uploads a file
> as a file attachment to an article. But I can't seem to get it to work.
> The documentation about mgd_create_file is kinda short.
> Can someone help me with a coded example?

mgd_create_file mainly creates an index record to an existing file. Move
the uploaded file to its destination, then do

mgd_create_file($article, $mimetype, $location, $size, $md5sum)

You'll have to deduce the mimetype from the file extension or use the type
that some browsers deliver with the upload. Size is available in a
upload-related PHP variable (I forgot which), and there's a php function
to calculate the md5 sum if you want it.

Alternatively, the 1.4b3 contains file attachment methods that allow
attachment of binaries to any record type. There's a description at
http://www.midgard-project.org/~emiliano/midgard-1.4b3-blobs.tar.gz

Emile



--
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]

Reply via email to