Content type application/octet-stream does not have a factory to be parsed
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 35/100
Rechercherichtung
Beginnen Sie mit der PHP SDK v2.24-Anfrage im Issue, insbesondere mit ContentRequestBuilderGetRequestConfiguration und der drives/items/content-Methodenkette. Reproduzieren Sie die format=pdf-Anfrage und verfolgen Sie, wo application/octet-stream geparst wird. Als erledigt gilt, festzustellen, ob das SDK oder die Anfrageverarbeitung den Fehler verursacht, und den Pfad zum Abrufen von PDF-Inhalten zu dokumentieren oder zu korrigieren.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Describe the bug
Hi I am following this guide to export the docx file
Giving error "Content type application/octet-stream does not have a factory to be parsed"
` try {
Log::info("oneDrivePath " . $oneDrivePath);
// Get the source document ID
$docxDriveItemId = $this->getDriveItemIdByPath($oneDrivePath);
Log::info("Attempting to retrieve PDF content for DriveItem: " . $docxDriveItemId); // Log before the get
$requestConfiguration = new ContentRequestBuilderGetRequestConfiguration();
$queryParameters = ContentRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->format = "pdf";
$requestConfiguration->queryParameters = $queryParameters;
// Get the PDF content by appending format=pdf to the request
$pdfContent = $this->graph->drives()
->byDriveId($this->drive_id)
->items()
->byDriveItemId($docxDriveItemId) // Append format parameter directly to ID
->content()
->get($requestConfiguration)
->wait();
...
`
can you please help where I am going wrong
Expected behavior
It should give pdf content
How to reproduce
use the php library
public function exportDocxToPdf($oneDrivePath, $oneDrivePDFPath): array | Exception
{
try {
Log::info("oneDrivePath " . $oneDrivePath);
// Get the source document ID
$docxDriveItemId = $this->getDriveItemIdByPath($oneDrivePath);
Log::info("Attempting to retrieve PDF content for DriveItem: " . $docxDriveItemId); // Log before the get
$requestConfiguration = new ContentRequestBuilderGetRequestConfiguration();
$queryParameters = ContentRequestBuilderGetRequestConfiguration::createQueryParameters();
$queryParameters->format = "pdf";
$requestConfiguration->queryParameters = $queryParameters;
// Get the PDF content by appending format=pdf to the request
$pdfContent = $this->graph->drives()
->byDriveId($this->drive_id)
->items()
// ->byDriveItemId($docxDriveItemId . '?format=pdf')
->byDriveItemId($docxDriveItemId) // Append format parameter directly to ID
->content()
->get($requestConfiguration)
->wait();
Log::info("PDF content retrieved successfully.");
} catch (\Exception $e) {
Log::error('Error exporting DOCX to PDF: ' , $e->getTrace() );
throw new Exception('Error exporting file to PDF: ' . $e->getMessage());
}
}
SDK Version
^2.24
Latest version known to work for scenario above?
^2.24
Known Workarounds
No response
Debug output
Click to expand log
```</details>
### Configuration
_No response_
### Other information
_No response_
- Vorherrschende Sprache
- PHP
- Sterne
- 669
- Forks
- 149
- Ø Merge
- 1 T. 4 Std.
- Gemergte PRs (30 T.)
- 5
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus microsoftgraph/msgraph-sdk-php
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
microsoftgraph/msgraph-sdk-php#1794 · 2 Kommentare ·
-
bug: metadata type:bug
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
microsoftgraph/msgraph-sdk-php#1739 · 6 Kommentare ·
-
status:waiting-for-triage type:bug
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 68/100
microsoftgraph/msgraph-sdk-php#1643 · 8 Kommentare · 4 Reaktionen ·
-
status:waiting-for-triage
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
microsoftgraph/msgraph-sdk-php#1800 · 3 Reaktionen ·
-
NowOffen
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 1/100
microsoftgraph/msgraph-sdk-php#1799 ·
Alle Issues in microsoftgraph/msgraph-sdk-php
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
matomo-org/plugin-CustomAlerts#310 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Bug Status: Needs Triage
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 68/100
php/web-php#2102 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
domain/checkout Platform(Default) priority/low testing/acceptance
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
pluginsGLPI/addressing#132 ·
-
5.14.0 PIE packages still declare PHP >=8.3, so PIE installs them on PHP 8.3 and the build failsOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100