I have managed to get to the point where I can get a stream created from my file from url. Having trouble figuring out how I can create the docuref and docuvalue table records from my stream. I have debugged the DocumentUpload form however the critical part of code is handled by the Uploadcontrol and I can't seem to get to the code that is actually sending the file to azure and getting back an id.
I have also looked at DocumentFileHelper::attachDocumentAsUser() however I'm having an issue with it wanting a string for documentcontents. Does anyone have an example of this being used to attach a jpeg?
Here is my code that generates the stream:
public void importFile()
{
System.IO.Stream newImage;
FileUploadTemporaryStorageResult result;
FileUploadTemporaryStorageStrategy strategy = new FileUploadTemporaryStorageStrategy();
//FileUploadTemporaryStorageResult result = File::GetFileFromUser() as FileUploadTemporaryStorageResult
//newImage = File::UseFileFromURL("C:\\Users\\axlocaladmin\\Downloads\\zhp710_P2.jpg");// as FileUploadTemporaryStorageResult;
newImage = File::UseFileFromURL("C:\\Users\\Public\\Documents\\zhp710_P21.jpg");
//result = strategy.uploadFile(newImage,"zhp710_P2","image/jpeg","jpg");
//File::SendFileToUser(newImage,"zhp710_P2","FileUploadTemporaryStorageStrategy");
}
You can see that I've played around with various options to no avail.
Thanks,
Don