Hi I need to download a file from an intranet folder where a new file is added at the end of every month.
How do i automate to download the latest month’s file to a specific folder? I tried using the download file activity but i cant get it to download the last uploaded file.
thanks for the reply. the file is located in a internal web that is only accessible within my organisation. the url goes like this: https://(organisation internal web).(organisation name).(department).(file name+date of file).csv, whereby the date of file will change to the end of every month.
do let me know if more information is needed. thank you!
Blockquote
Dim httpRequest As HttpWebRequest = DirectCast(WebRequest.Create(“https://url.pdf”), HttpWebRequest)
httpRequest.Method = WebRequestMethods.Http.Get
Dim httpResponse As HttpWebResponse = DirectCast(httpRequest.GetResponse(), HttpWebResponse)
Dim httpResponseStream As Stream = httpResponse.GetResponseStream()
Dim doc As Byte()
Dim ms As MemoryStream = New MemoryStream()
httpResponseStream.CopyTo(ms)
doc = ms.ToArray()
File.WriteAllBytes(“C:\yourfile.pdf”, doc)