Welcome to K2 Underground Sign In | Join | Help
HowTo URL link that will download files directly from a SmartBox SmartObject

Attached is a project with two forms. 

If you want to play with the code and watch it work:
    - deploy the Attachments.sodx SmartObject
    - Open the web app solution
    - debug (F5) default.aspx
    - make sure the BPHostServer is to your BP Server
    - make sure that the file path points to a file you can get to from the BP Server
    - click the test button twice

If you want to grab the code quickly, open the RetrieveFile.aspx.cs file within the project.

Some of the code included was created by Jacques Olivier.

NOTE that you cannot use the ExecuteReader way of getting at SmartObject file properties to do the response.BinaryWrite that I've used here, you will receive an error:  cannot convert from 'object' to 'byte[]'    even though the .GetType() method of the property does return System.Byte[]...

 (Oh and by the way, this script is case sensitive on the file name... sorry ;) 

Published Wednesday, August 13, 2008 12:01 AM by Joseph


Attachment(s): TestSmartObjectFiles.zip

Comments

No Comments

Anonymous comments are disabled
Powered by Community Server (Commercial Edition), by Telligent Systems