Skip to main content

I was testing a workflow and I got an error in an InfoPath Client Event.


When the UploadDocumentFromURL executes, I get the error message "Value does not fall within the expected range".



Dim ret As Boolean, errMess As String
FileURL = strWorkSpaceURL + strDocLib + FileName
If spsList.UploadDocumentFromUrl(strWorkSpaceName, FileURL, oByte, True, errMess) Then
  'Update the Activity Fields for Cleanup purposes
  K2.ActivityInstanceDestination.DataFields("SPFileURL").Value = FileURL
  K2.ActivityInstanceDestination.DataFields("SPFileSite").Value = strWorkSpaceName
Else
  Throw New System.Exception(errMess)
End If


I have compared this to other workflow's code and I think I'm missing something because I can't get this to work. Any ideas why I get this error?


Thanks in advance,


Monica

Hi Monica,


Do you know what the values of 'strWorkspaceName' and 'FileURL' is by the time the UploadDocumentFromUrl method is called?  If not, I would suggest doing a couple of console.writelines and view them in the K2Server Console window to make sure these values are set correctly.  If you're maybe making use of an IP Address in the URL, try to change it to a Server Name.


 Regards,


Ockert


I did review the values and they were the same or similar to the ones in other workflows that were working correctly. That's why I was so confused.


Tongue Tied It seems that we had the incorrect version of the solution. That's why it had some weird errors. We found the latest version and it works perfectly. Sorry for the trouble.


 Thanks Ockert for the reply! 🙂


Reply