0
votes

We are getting error Error during upload when uploading a file that is configured to save files to SharePoint Online. This is on Microsoft Dynamics AX 2012 R3.

We have document management enabled, we are currently saving files to a local folder on the AOS server but now want to save files to our online sharepoint library in O365.

  1. I created the following folder AXTest in sharepoint, and granted the AX service account access to the sharepoint team.

enter image description here

  1. I set Archive directory appropriately. I tried various veresions of the URL, which were all unsuccessful:

enter image description here

  1. All result in error when trying to upload a file that is local to the AOS server: enter image description here

  2. Through debugging, the error is raised here.

enter image description here

There is no exception stack so I don't know the exact reason why, but we tried various versions of the URL, we tried uploading a file locally, and we know the service account has access to the sharepoint site/team. Any other ideas?

2
This might be an obvious question, but did you choose SharePoint Online for authentication type under document management parameters?Alex Kwitny
thanks @AlexKwitny, yes we had enabled that authentication type.Greg

2 Answers

1
votes

Late but the "solution" is to make sure that a persistent cookie for SharePoint Online exists locally. I have been biting my head off to find a better solution, because it can get pretty complex to get that persistent cookie which makes it not suitable for end-users. To the point that my only solution might be to build a custom connector (or to urge for an upgrade...)

The key is to somehow force login.microsoftonline.com to prompt the user the question to remain signed-in. Only when you click Yes in that dialog is a persistent cookie created for SPO. Then the upload works fine, until the cookie expires / gets deleted.

These are the instructions for our users:
1. Make sure SPO / MS / Azure / ADFS related urls are not in the intranet zone in IE to prevent automatic login with windows credentials.
2. Sign out of SPO
3. Delete browser cookies
3. Restart IE
4. Go to SPO
5. You should be prompted to login with username and password
6. Then you will receive the question to Remain signed in. Click Yes.

Optional if this didnt work: Reset IE to default settings.

There's a KB included in CU13 for AX2012 R3 that seems to address the issue (mentions the vague "Error during upload" error). Haven't tested it myself, because i am trying to solve it in an AX2012 R2 CU9 environment.

1
votes

I just ran across the same issue and what a NIGHTMARE!

For Windows Server 2012 R2, I wrote this little PowerShell script to help clear the cookies for all users.

We had users sign out of AX, sign off the terminal server(s), and then I ran the below script to just remove all user cookies. Next connection, they were in business.

$Remove = $false

Get-ChildItem -Path "C:\Users" -Directory | % {

    $CachePath = Join-Path -Path $_.FullName -ChildPath "\AppData\Local\Microsoft\Windows\INetCache"
    $CookiePath = Join-Path -Path $_.FullName -ChildPath "\AppData\Local\Microsoft\Windows\INetCookies"

    if (Test-Path -Path $CookiePath)
    {
        Write-Host $_.FullName -ForegroundColor Green

        if ($Remove) {
            Get-ChildItem -Path $CookiePath -File -Recurse | Remove-Item -Force -ErrorAction Continue
            Get-ChildItem -Path $CachePath -File -Recurse | Remove-Item -Force -ErrorAction Continue
        } else {
            Get-ChildItem -Path $CookiePath -File -Recurse | Format-Table -AutoSize
            Get-ChildItem -Path $CachePath -File -Recurse | Format-Table -AutoSize
        }
    }
}