Get list items attachments only gives me the name of the file

I have another set of credentials but those are the same, my Windows Credentials.
I’ve not tried to change the file tipe, maybe it could worked, but with help of my manager, we have found a way to download the file without issues (and after if we open the downloaded file since local folder it don’t requests credentials or to pass it to edit mode). I have used an “Invoke Code” with a part of code that had my manager to interact with our sharepoint lists, I’ve replaced some data by In arguments and it just work fine! It works perfectly and it’s very fast! :star_struck:

image

This is the code (in case of someone wants to use this solution, I’ve marked the things to replace between asterisks (**), the ones that starts by “IC_” are the arguments, the only thing that we’ve inserted with static text on the code is the URL of the Sharepoint site because for us is always the same for all requests for all teams):

    Dim context As New ClientContext(**"http://our.sharepoint.url:port/SUBSITENAME"**)
    Dim web As Web = context.Web

    Dim collList As ListCollection = web.Lists

    Dim oList As List
    Dim existe As Boolean

    existe = False

    ' Carga las listas del site GMC
    context.Load(collList)
    context.ExecuteQuery()
    For Each oList In collList
        If oList.Title = **IC_ListName** Then
            existe = True
            Exit For
        End If
    Next

    If existe Then
        Dim query As New Microsoft.SharePoint.Client.CamlQuery
        Dim itemList As ListItemCollection = oList.GetItems(query)

        context.Load(itemList)
        context.ExecuteQuery()
        Dim oItem As ListItem
        Dim existed As Boolean
        existed = False
        For Each oItem In itemList
            If oItem.Id = **IC_ID** Then
                existed = True
                Exit For
            End If
        Next

        If existed Then
           Dim client1 As New System.Net.WebClient
    client1.UseDefaultCredentials = True
    client1.DownloadFile(**IC_FileURL** , **IC_LocalFolder**)
			End If
			
    End If
	Console.WriteLine("Archivo descargado!!!")
1 Like