By Maria Mir on
1/13/2010 8:27 AM
In this post I am going to describe a scenario which was a little different from the ones usually found over the internet. The objective was to set up a document library to receive email and upload the received files to an FTP.
I created a workflow in Visual studio 2008 and set it up on the document library. FOllowing is the code in the workflowactivated event. (there is just one activity in the workflow)
1: Private Sub onWorkflowActivated1_Invoked(ByVal sender As System.Object, ByVal e As System.Workflow.Activities.ExternalDataEventArgs)
2: Try
3: Dim request As FtpWebRequest = CType(WebRequest.Create(ConfigurationManager.AppSettings("FTPHost") + Me.workflowProperties.Item.File.Name), FtpWebRequest)
4: request.Method = WebRequestMethods.Ftp.UploadFile
5: request.Credentials = New NetworkCredential(ConfigurationManager.AppSettings("FTPUser"), ConfigurationManager.AppSettings("FTPPassword"))
...
Read More »