I am trying to save binary data to the database using a custom field type, however I am unable to get the FileUpload control to actually upload the file. I looked at the DbImage sample, but was unable get it to work (the page to post back when the update link is clicked). What am I missing?
Excerpt from filePDF_Edit.ascx.cs
1 protected override void ExtractValues(IOrderedDictionary dictionary)
2 {
3 if (FileUpload1.HasFile) {
4 dictionary[Column.Name] = new System.Data.Linq.Binary(FileUpload1.FileBytes);
5 }
6 }
filePDF_Edit.ascx:
1 <%@ Control Language="C#" CodeBehind="filePDF_Edit.ascx.cs" Inherits="MaterialsWeb2.filePDF_EditField" %>
2
3 <asp:HyperLink runat="server" ID="Hyperlink1"
4 Text="PDF" ImageUrl="~/Images/go.gif" />
5
6 <asp:FileUpload ID="FileUpload1" runat="server" />
7