Skip to content

Attachments upload not working #40

Closed

Description

@petaak

Attachments upload does not work after updating to the latest dev-main version. After some research I think it is caused by this commit ab6b9e6. Previous revision (85f48f4) works fine.

My code:

$connectionOptions = [
            'company' => $this->companyName,
            'url' => $this->serverUrl,
            'user' => $this->username,
            'password' => $this->password,
        ];
$invoiceId = 1234;
$fakturaPrijata = new FakturaPrijata($invoiceId, $connectionOptions);
$priloha = Priloha::addAttachment($fakturaPrijata, 'attachment.txt', 'Attachment content', 'text/plain');

The response HTTP code is 401 and the body says "Authorization required":

{"winstrom":{"@version":"1.0","success":"false","message":"Authorization required"}}

Activity

  1. petaak commented on Jul 9, 2024

    @petaak
    ContributorAuthor

    There is no username and password in the Authorization HTTP header of the request. The header looks like this:

    Authorization: Basic Og==
    

    Only the colon is encoded in the base64 string.

  2. added
    bug
    on Jul 9, 2024
  3. added this to the AbraFlexi milestone on Jul 9, 2024
  4. self-assigned this
    on Jul 9, 2024
  5. added a commit that references this issue on Jul 12, 2024
  6. linked a pull request that will close this issueFIX: Attachment upload #40 #41on Jul 12, 2024
  7. added a commit that references this issue on Jul 12, 2024
  8. Vitexus commented on Jul 12, 2024

    @Vitexus
    Collaborator

    @petaak please confirm functionality

  9. petaak commented on Jul 12, 2024

    @petaak
    ContributorAuthor

    It works, thanks for the quick fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions