Upload and send additional information with file to UploadHandler

Sep 13, 2013 at 10:09 PM
Hello,

I just downloaded version 3.0. Great add-in by the way! I had a question regarding passing information from the client along with the file. I need to pass a foreign key value with the file so I can then parse and upload the data to SQL. The code to parse the file is already completed and the upload works well also. What I am missing is this foreign key that I need to have in order to process the data to the correct SQL table.

I looked at the following post and I get the idea, but the implementation seems to be for version 2.0. What would I need to change in the control type to get this working?

https://interlink.codeplex.com/discussions/225999

The following does not seem to instantiate:
var udialog = new HSS.Interlink.UploadFileDialog();
Coordinator
Sep 13, 2013 at 10:18 PM
Thanks for the positive feedback.
For 3.0, if you’re using the UploadControl, there is now an Event that you subscribe to that will provide your handler with an appropriate EventArg object allowing you to provide the metadata string to pass along with the file being uploaded.
If you look at the UploadControl.cs file, you can see the event towards the beginning of the class for details.
Thanks again,
--Glen
From: MarkSA
Sent: ‎Friday‎, ‎September‎ ‎13‎, ‎2013 ‎6‎:‎09‎ ‎PM
To: Glen Banta

From: MarkSA

Hello,

I just downloaded version 3.0. Great add-in by the way! I had a question regarding passing information from the client along with the file. I need to pass a foreign key value with the file so I can then parse and upload the data to SQL. The code to parse the file is already completed and the upload works well also. What I am missing is this foreign key that I need to have in order to process the data to the correct SQL table.

I looked at the following post and I get the idea, but the implementation seems to be for version 2.0. What would I need to change in the control type to get this working?

https://interlink.codeplex.com/discussions/225999

The following does not seem to instantiate:
var udialog = new HSS.Interlink.UploadFileDialog();
Sep 13, 2013 at 11:10 PM
Thank you for the very quick response! The information was right there in my face this whole time. I should have taken the time to read the documentation and the examples. This is the line that I needed and everything now processes well.
private void uploadControl_GetMetadata(object sender, GetMetadataEventArgs e)
        {
            e.Metadata = e.FileName;
        }
Thanks again!