I am using umbraco with a custom data type to attach files to a PDF. When I go and try to transfer the information with courier this does not get treansferred. I have tried to add an XPath and a regular expression to the courier.config but with no luck. Also tried umbraco support and they seemed to be stumpt by this as well.. Any help would be greatly appreciated. Here is what I have tried so far with the code:
I'm having problems with Courier too, so maybe we can help each other :)
Can you clarify your set up? As I understand it, you have a custom datatype that contains a reference to a Media node where the PDF is located? Or does it contain the location of a PDF in the filesystem? I can both of these Scenarios to work fine (link to Media and link to file) - I'm stuck with a link to a content node!
I have the problem with umbraco courier.Whenever i transfer any media file like pdf,doc,xls(except image files .gif,.png,.jpeg) from staging to live(destination environment), it doesnot transferring the media files.That means, the content nodes are getting transferred, but the files like pdf,doc,xls included with in that page is not getting transferred.
But there is not having an issue with image files as I mentioned above.
The umbraco version Using is : 4.0.2.1
The courier vesion using is : 1.3
Could anyone please suggest an idea about why this is happening?
Also, please suggest the solution for fixing the same.
Courier Not Transferring Custom Datatype Files
Hi All,
I am using umbraco with a custom data type to attach files to a PDF. When I go and try to transfer the information with courier this does not get treansferred. I have tried to add an XPath and a regular expression to the courier.config but with no luck. Also tried umbraco support and they seemed to be stumpt by this as well.. Any help would be greatly appreciated. Here is what I have tried so far with the code:
ProductDocuments.ascx
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="ProductDocuments.ascx.vb" Inherits="usercontrols_datatype_ProductDocuments" %>
<asp:ListBox ID="ListBox1" runat="server" Width="300" Height="200"></asp:ListBox>
<asp:Button ID="btnDelete" runat="server" Text="Remove Item" />
<br />
<table>
<tr>
<td>Document:</td>
<td><asp:DropDownList ID="DropDownList1" runat="server"></asp:DropDownList></td>
</tr>
<tr>
<td>File:</td>
<td><asp:DropDownList ID="DropDownList2" runat="server"></asp:DropDownList></td>
</tr>
<tr>
<td></td>
<td><asp:Button ID="btnAdd" runat="server" Text="Add" /></td>
</tr>
</table>
<br />
<asp:HiddenField ID="hdnValue" runat="server" />
<br />
ProductDocuments.ascx.vb
Imports
System.Xml
Imports
umbraco.cms.businesslogic.media
Partial
Classusercontrols_datatype_ProductDocuments
InheritsSystem.Web.UI.UserControl
Implementsumbraco.editorControls.userControlGrapper.IUsercontrolDataEditor
Private doc As NewXmlDocument()
Public Property value() As Object Implementsumbraco.editorControls.userControlGrapper.IUsercontrolDataEditor.value
Get
'Return DropDownList1.SelectedValue
'Return HiddenField1.Value
'Return String.Empty
'Return hdnValue.Value
Returndoc.InnerXml()
EndGet
Set(ByVal value As Object)
If Not IsDBNull(value) AndAlso Not String.IsNullOrEmpty(value)Then
Try
doc.LoadXml(value)
LoadData()
'hdnValue.Value = doc.OuterXml().ToString()
Catch
doc.LoadXml(
"<documents />")
EndTry
EndIf
EndSet
EndProperty
Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
doc.LoadXml(
"<documents />")
EndSub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBackThen
'doc.LoadXml("<specs />")
hdnValue.Value = doc.OuterXml.ToString()
Dim xds As NewXmlDataSource()
xds.DataFile =
"/inc/product_documents.xml"
xds.XPath =
"//option"
DropDownList1.DataSource = xds
DropDownList1.DataTextField =
"name"
DropDownList1.DataValueField =
"name"
DropDownList1.DataBind()
DropDownList1.Items.Insert(0,
New ListItem("Please Choose...", String.Empty))
Dim m As NewMedia(2398)
For Each f As Media Inm.Children
DropDownList2.Items.Add(
New ListItem(f.Text, String.Format("{0}||{1}", f.Id, f.Text)))
Next
DropDownList2.Items.Insert(0,
New ListItem("Please Choose...", String.Empty))
Else
doc.LoadXml(hdnValue.Value)
EndIf
EndSub
SubLoadData()
ListBox1.Items.Clear()
Dim index As Integer= 1
For Each n As XmlNode In doc.SelectNodes("//document")
ListBox1.Items.Add(
New ListItem(n.Attributes("name").Value & ": " & n.Attributes("file").Value, index))
index += 1
Next
hdnValue.Value = doc.OuterXml.ToString()
EndSub
Protected Sub btnAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs) HandlesbtnAdd.Click
'Response.Write("[[" & hdnValue.Value & "---" & doc.OuterXml.ToString() & "]]")
Dim name As String= DropDownList1.SelectedValue
If Not String.IsNullOrEmpty(name) AndAlso Not String.IsNullOrEmpty(DropDownList2.SelectedValue)Then
Dim value As String() = Split(DropDownList2.SelectedValue, "||")
Dim node As XmlNode = doc.CreateElement("document")
Dim at AsXmlAttribute
at = doc.CreateAttribute(
"name")
at.Value = name
node.Attributes.Append(at)
at = doc.CreateAttribute(
"file")
at.Value = value(1)
node.Attributes.Append(at)
at = doc.CreateAttribute(
"id")
at.Value = value(0)
node.Attributes.Append(at)
doc.DocumentElement.AppendChild(node)
LoadData()
EndIf
DropDownList2.SelectedValue =
String.Empty
DropDownList1.SelectedValue =
String.Empty
EndSub
Protected Sub btnDelete_Click(ByVal sender As Object, ByVal e As System.EventArgs) HandlesbtnDelete.Click
If Not String.IsNullOrEmpty(ListBox1.SelectedValue)Then
'Response.Write("[[" & ListBox1.SelectedValue & "]]")
Dim node As XmlNode = doc.SelectSingleNode("//document[" & ListBox1.SelectedValue & "]")
If node IsNot NothingThen
node.ParentNode.RemoveChild(node)
LoadData()
EndIf
EndIf
EndSub
'Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
' Dim debug As New TextBox()
' debug.Text = doc.OuterXml.ToString()
' debug.TextMode = TextBoxMode.MultiLine
' debug.Width = 400
' debug.Height = 400
' Me.Controls.Add(debug)
'End Sub
End
ClassAny help would be greatly appreciated with this since we basically can't use courier until this is fixed..
Thanks
Hi,
I'm having problems with Courier too, so maybe we can help each other :)
Can you clarify your set up? As I understand it, you have a custom datatype that contains a reference to a Media node where the PDF is located? Or does it contain the location of a PDF in the filesystem? I can both of these Scenarios to work fine (link to Media and link to file) - I'm stuck with a link to a content node!
TTFN
Ant
Hi All,
I have the problem with umbraco courier.Whenever i transfer any media file like pdf,doc,xls(except image files .gif,.png,.jpeg) from staging to live(destination environment), it doesnot transferring the media files.That means, the content nodes are getting transferred, but the files like pdf,doc,xls included with in that page is not getting transferred.
But there is not having an issue with image files as I mentioned above.
The umbraco version Using is : 4.0.2.1
The courier vesion using is : 1.3
Could anyone please suggest an idea about why this is happening?
Also, please suggest the solution for fixing the same.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.