File Attachment Property

350 views
Skip to first unread message

Tom Komin

unread,
Feb 25, 2016, 4:55:09 PM2/25/16
to XMPie Interest Group
I am using the "file attachment" property and wanted to find out if there is a way to automatically put the attached files into a folder on the server or attaching the files (or link to the files) to the order email.

Right now, we have to log into the admin and manually download the files. I am trying to find a way to automate this. I tried using the prepress setup with a freeflow core workflow but i am told this won't work since I am not using the standard upload function.

Thanks,
Tom Komin
Altered Images


couch

unread,
Feb 25, 2016, 5:42:16 PM2/25/16
to XMPie Interest Group
The files them selves are uploaded to:
X:\XMPie\uStore\App\uStoreShared\FileAttachments\<orderProductID>\<filename>_<fileID>.<fileExtension>
The name of the file and teh file ID can be queried from the orderProductDialValue table.
So, given the above, you could add a file share link to your email, or (if necessary) you could setup an IIS virtual directory pointing at the uStoreShared folder and translate a http link to the file in your email.

Drew

unread,
Dec 1, 2016, 4:33:12 PM12/1/16
to XMPie Interest Group
Our server is hosted, is it possible to add a link to the order email for us to download the file attachment?

couch

unread,
Dec 1, 2016, 7:36:05 PM12/1/16
to XMPie Interest Group
The easy solution here is to get the link to the file attachment by logging into uStore admin, and click on the product in the orders list. The link will be on the order product details page.

That said, yes, you can edit the email xsl template and add a hyperlink but the uploaded files are by default not accessible to the internet. You will first need to expose the uploaded files to the internet by creating a virtual directory in IIS that points to <installdrive>:\XMPie\uStore\App\uStoreShared\FileAttachments

You will also need to add an message template SQL query to get the name of the uploaded file from the uStore database like this:

SELECT        FriendlyValue
FROM            OrderProductDialValue
WHERE        (OrderProductID = @OrderProductId) AND (DialID = 111111)

(substitute 11111 with the id # of your file attachment dial.)

You can then add XSL to your message template to build the path to your virtual folder, and add the order product id and "/" and the filename from your qurey.

<xsl:if test="normalize-space(//Sqls/FileUpload/Row/FriendlyName)!=''">
<xsl:element name="a"><xsl:attribute name="href">http://<xsl:value-of select="//Sqls/StoreName/Row/LandingDomain" />/YourVirtualDirectoryName/<xsl:value-of select="//Sqls/OrderProductList/Row/OrderProductID" /></xsl:attribute>Download file attachment</xsl:element>
</xsl:if>

Of course you will have to set the name of the virtual directory you created, and to cater for orders with multiple products, you will probably have to adjust the above code somewhat so that the link is evaluated for each order product.

Don't try this at home unless you have the necessary skills with IIS, SQL and XSL or can get help from someone who does...

couch

unread,
Dec 1, 2016, 7:49:38 PM12/1/16
to XMPie Interest Group
I missed the friendly name again at the end of the link:

<xsl:if test="normalize-space(//Sqls/FileUpload/Row/FriendlyName)!=''">
<xsl:element name="a"><xsl:attribute name="href">http://<xsl:value-of select="//Sqls/StoreName/Row/LandingDomain" />/YourVirtualDirectoryName/<xsl:value-of select="//Sqls/OrderProductList/Row/OrderProductID" />/<xsl:value-of select="//Sqls/FileUpload/Row/FriendlyName" /></xsl:attribute>Download file attachment</xsl:element>
</xsl:if>

Drew McLellan

unread,
Dec 1, 2016, 7:57:49 PM12/1/16
to xmpie...@googlegroups.com

The server is hosted by xmpie, I assume that's where the IIS would take place? And on the order details page it uses javascript to download the file so no link shows.


--
You received this message because you are subscribed to a topic in the Google Groups "XMPie Interest Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/xmpie-users/oQ0wA62I0L0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to xmpie-users+unsubscribe@googlegroups.com.
To post to this group, send email to xmpie...@googlegroups.com.
Visit this group at https://groups.google.com/group/xmpie-users.
For more options, visit https://groups.google.com/d/optout.

couch

unread,
Dec 1, 2016, 8:02:46 PM12/1/16
to XMPie Interest Group
From what I understand, if the server is hosted and you don't have access to the server to make changes to IIS, then it is not possible. 

Your only choice will be to use the uStore admin interface to get the uploaded file via the order product details page.

Simon Knott

unread,
Nov 8, 2019, 7:56:56 AM11/8/19
to XMPie Interest Group
Hi Couch

Apologies to resurrect an old post but I am trying to implement this exact thing on a message template but I have a bit of an issue.

I have successfully managed to do everything as you instructed and can generate the name of the original filename uploaded.

The problem I have is that the uploaded file is saved out into the D:\XMPie\uStore\App\uStoreShared\FileAttachments directory and when it is a unique ID is appended to each file before the file extension for example "Order Print.pdf" becomes "Order Print_61656b92-a2ca-4ea5-8a20-8428a76679f6.pdf" 

My question is, where is this ID generated and how can I get in the SQL query either this full filename or add in the unique ID for my SQL query to pick up the correct filename so I can provide the right download link? 

Would appreciate any help on this, have also asked support and they too are not able to tell me where this ID comes from?

Regards
Simon Knott

couch

unread,
Nov 14, 2019, 11:59:34 PM11/14/19
to XMPie Interest Group
Look for the FileSubmissionDocumentUniqueID field of the FileSubmissionDocument table.

Simon Knott

unread,
Nov 15, 2019, 6:11:55 AM11/15/19
to XMPie Interest Group
Hi Couch

Thanks for this unfortunately the FileSubmissionDocument table refers to items uploaded via a composite product such as document builder. I am trying to locate the ID that is appended when you upload a product via the FileAttachment product property.

Do you know where I can find that?

Regards
Simon Knott

Wayne

unread,
Nov 15, 2019, 6:49:08 AM11/15/19
to XMPie Interest Group
Hi Simon,
The FileAttachment Details are stored in the [OrderProductDialValue] Table in the DialValue field as XML.
I would strongly recommend that you write your own proxy service to download the file rather than exposing a virtual directory.

Regards,
Wayne

Simon Knott

unread,
Nov 20, 2019, 6:55:54 AM11/20/19
to XMPie Interest Group
Hi Wayne

I was able to get the filename of the item that was uploaded from the OPDV table however as I stated when it is saved into the D:\XMPie\uStore\App\uStoreShared\FileAttachments directory a unique ID is appended onto the filename and I cannot work out where this is coming from. I want to simply include a download link on a message template to allow the production team to download the item that has been uploaded by the customer but without knowing what creates that ID I am unable to do this.

I was hoping someone would know is it a stored procedure or something and if so can I utilise that in my SQL query to give the correct resulting filename?

Regards
Simon

Wayne

unread,
Nov 20, 2019, 3:35:46 PM11/20/19
to XMPie Interest Group
Hi Simon

The unique ID you are referring to is a guid that gets generated when the File Attachment is uploaded.
Its not stored anywhere else other than in the OPDV file as XML.

The Dial Control allows for multiple File Attachments so you will need to accommodate for this in you SQL XML Query.


Regards,
Wayne
Reply all
Reply to author
Forward
0 new messages