Dim myFile As HttpPostedFile = DMSfile.PostedFile
‘add myDMSAssets as folder in site root directory
DMSfile.PostedFile.SaveAs(Server.MapPath("~/path/") & myFile.FileName)
Dim fs As New System.IO.FileStream(Server.MapPath("~/path/" & myFile.FileName), IO.FileMode.Open)
Dim UpdateFile As New Ektron.Cms.AssetUpdateData
UpdateFile.FileName = myFile.FileName
UpdateFile.LanguageId = 1033
‘add a folder in the WorkArea for DMS documents
UpdateFile.FolderId =
UpdateFile.Title = myFile.FileName & " " & Date.Now()
UpdateFile.EndDate = Date.Now.AddMonths(6)
UpdateFile.Teaser = "Name: " & txtName.Text & "
Dim dmsURL As String = ""
Dim contentAPI As New Ektron.Cms.API.Content.Content
Dim dmsID As Integer = contentAPI.AddAsset(fs, UpdateFile)
System.IO.File.Delete(Server.MapPath("~/path/" & myFile.FileName))
Dim myContentBlock As New Ektron.Cms.Controls.ContentBlock
myContentBlock.DefaultContentID = dmsID
myContentBlock.Page = Page
myContentBlock.Fill()
Dim myAsset As New Ektron.Cms.API.Content.Asset
dmsURL = myAsset.GetViewUrl(myContentBlock.EkItem.AssetInfo.Id, 0)
<div id="_mcePaste"></div>
<div id="_mcePaste"><p runat="server" id="DMSUpload" visible="true"></div>
<div id="_mcePaste"><asp:Label ID="DMSlabel" runat="server" AssociatedControlID="DMSfile" Text="Select File:" /></div>
<div id="_mcePaste"><asp:FileUpload ID="DMSfile" runat="server" /></div>
<div id="_mcePaste"><asp:RegularExpressionValidator ID="DMSreg" runat="server"</div>
<div id="_mcePaste">ControlToValidate="DMSfile"</div>
<div id="_mcePaste">ValidationExpression="^.+\.(doc)$"</div>
<div id="_mcePaste">ErrorMessage="resume can only be in .doc format" /></div>
<div id="_mcePaste"></p></div>
<div id="_mcePaste"><asp:Button ID="btnAddDMS" runat="server" Text="Upload" /></div>
Name: <asp:TextBox ID="txtName" runat="server" /> <br /> Desired Position: <asp:TextBox ID="txtPosition" runat="server" /> <br /> Brief Summary: <asp:TextBox ID="txtSummary" runat="server" /> <p runat="server" id="DMSUpload" visible="true"> <asp:Label ID="DMSlabel" runat="server" AssociatedControlID="DMSfile" Text="Select Resume:" /> <asp:FileUpload ID="DMSfile" runat="server" /> <asp:RegularExpressionValidator ID="DMSreg" runat="server" ControlToValidate="DMSfile" ValidationExpression="^.+\.(doc)$" ErrorMessage="resume can only be in .doc format" /> </p> <asp:Button ID="btnAddDMS" runat="server" Text="Upload" />
Hi, do you happen to have this code in c#? I am looking for this type of function. Thanks