Hello,

in my application there is a need for users to add there own pages and
an a page you should be able to upload files (Word, Excel), multiple
files.

So instead of defining "Field('picture','upload',default=''))" in my
page table I made a own table just for the files.

First I didn´t have the file uploading feature so the form to make a
new page is made with "form = SQLFORM(db.page, ....."

To get the upload file option when creating the page I put
  <tr>
    <td><input type="text" name="file_desc" /></td>
    <td><input class="upload" id="page_file" name="page_file"
type="file" /></td>
  </tr>

and
        if (request.vars.page_file != ""):
            page_file_id = db.page_files.insert(
                file = request.vars.page_file,
                description = request.vars.file_desc,
                page = form.vars.id)

This doesn´t work, the database i populate but wrongly I think.

The problem is I think in the HTML code.

When reading the examples I found this text: "Remember the
upload=URL(...'download'...) statement in the register_dog function.",
but when reading the register_dog function I couldn´t find the
statement.

Any exemples how to do this?


Kenneth

Reply via email to