close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Issue insert record with upload file field.

Thread began 2/26/2010 12:35 pm by account134484 | Last modified 3/03/2010 7:52 pm by Jason Byrnes | 3109 views | 10 replies |

account134484

Issue insert record with upload file field.

I have created an insert record form with one file field, using the instructions found here dfp_da_insert_update_ht.pdf

You can see the form at the link below.

add_homework.php
Username: support
Password: user

The problem I am having is I need the uploaded files associated with the database record, so when the student logs in to get their homework assignments, they know which files to download.

Right now I am getting an error "Column 'docs' cannot be null"

Sign in to reply to this post

Jason ByrnesWebAssist

please send a copy of the page so I can examine the code.

Sign in to reply to this post

account134484

see attachment.

Sign in to reply to this post

Jason ByrnesWebAssist

There is no attachment to see.


can you add the php file to a zip archive and attach the zip file to your reply.

Sign in to reply to this post

account134484

try this again

Attached Files
add_homework.php.zip
Sign in to reply to this post

Jason ByrnesWebAssist

The heart of the issue is that you cannot do this using the Dreamweaver insert record behavior.

The Dreamweaver insert record behavior is limited in that it will only allow you to store form information in the database.


When a file is uploaded, the file field does not actually send a value, it sends the bits of the file.

The digital file pro Upload File behavior takes these bits and recreates the file on the server.

Once the file is created on the server, a php variable is created that contains the Server File Name.

You need to use the DataAssist insert record behavior to be able to use the Server File name variabel when inserting the record.

See the "How to apply Digital File Pro to DataAssist Insert and Update pages " tutorial in the how to section of the Digital File pro support page:
digital-file-pro/

Sign in to reply to this post

account134484

Update

I have followed the steps again, but the file isn't uploading and it is not being recorded in the db.

See attachment.

Attached Files
homework_Insert.php.zip
Sign in to reply to this post

Jason ByrnesWebAssist

1) Try using the Button Insert pressed trigger for the File Upload behavor.

2) In the insert record server behavior, bind the docs column to the Server File Name variable instead of the form element.

Sign in to reply to this post

account134484

Update

The file is uploading to the proper folder, but when you try to download the file, it isn't linked correctly.

homework_Detail.php?homeword_id=26

uploads to here:
upload/

links to here:
register_4.pdf

instead of:
register_4.pdf

Sign in to reply to this post

account134484

Update

I have three file fields, so users can upload more than one file. I have already followed steps to upload the first file, but I need to know how two setup the remaining two file fields and make sure they record to the same id.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...