Skip to content

Unable to upload PDF files to the Media Library via URL #78471

Open

Description

Quick summary

Our Media Libray allows uploading media files from a URL, but it returns an error for PDF files.

Steps to reproduce

  1. Navigate to your Media Library
  2. Use the arrow next to the Add New button to select the option to Add via URL
  3. Insert your PDF URL (example: https://www.africau.edu/images/default/sample.pdf)
  4. Notice the upload fails and returns the error 1 file could not be uploaded because an error occurred while uploading.

What you expected to happen

The PDF file to show in the Media Library.

What actually happened

The upload fails and an error is returned.

@dragstor noticed this response from an XHR request on an Atomic site:

{
    "code": 400,
    "headers": [
        {
            "name": "Content-Type",
            "value": "application\/json"
        }
    ],
    "body": {
        "error": "",
        "message": ""
    }
}

And this one on a Simple site:

{
    "code": 400,
    "headers": [
        {
            "name": "Content-Type",
            "value": "application\/json"
        }
    ],
    "body": {
        "errors": [
            {
                "file": "https:\/\/www.africau.edu\/images\/default\/sample.pdf",
                "error": "invalid_input",
                "message": "Invalid file type."
            }
        ]
    }
}

Impact

Some (< 50%)

Available workarounds?

Yes, easy to implement

Platform (Simple and/or Atomic)

Simple, Atomic

Logs or notes

6416275-zd-woothemes
p2EDhh-20Q-p2#comment-8679

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

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions