---
url: 'https://dxpr.com/zh-hans/hc/documentation/learn-dxpr-builder/troubleshooting/images-and-media'
title: '图像不上传或消失 | DXPR'
author:
  name: Jurriaan
  url: 'https://dxpr.com/users/jurriaan'
date: '2026-10-24T08:22:59+00:00'
updated: '2026-10-24T09:09:48+00:00'
copyright: 'Copyright DXPR. All rights reserved.'
type: article
summary: 让上传正常工作并将上传文件保留在网站上。图像通过页面构建器自带上传到达页面，网站使用媒体库时则通过媒体库。大多数失败是媒体设置、文件权限或上传未到达服务器所致。
tags:
  - 'Fix a problem'
image: 'https://dxpr.com/themes/custom/dxpr_com/images/dxpr-share-card.jpg'
published: true
og:
  site_name: DXPR
  updated_time: '2026-10-24T09:09:48+0000'
  'image:alt': 'DXPR, powered by Drupal: AI-powered Drupal for marketers.'
schema:
  '@context': 'https://schema.org'
  '@graph':
    -
      mainEntity: {  }
    -
      '@type': TechArticle
      headline: 图像不上传或消失
      description: 让上传正常工作并将上传文件保留在网站上。图像通过页面构建器自带上传到达页面，网站使用媒体库时则通过媒体库。大多数失败是媒体设置、文件权限或上传未到达服务器所致。
      image:
        '@type': ImageObject
        url: 'https://dxpr.com/themes/custom/dxpr_com/images/dxpr-share-card.jpg'
        width: '1200'
        height: '630'
      datePublished: '2026-10-24T08:22:59+0000'
      dateModified: '2026-10-24T09:09:48+0000'
      author:
        '@type': Organization
        '@id': 'https://dxpr.com/#organization'
        name: DXPR
        url: 'https://dxpr.com/'
        logo:
          '@type': ImageObject
          url: 'https://dxpr.com/themes/custom/dxpr_com/dxpr-logo-dark.svg'
          width: '1348'
          height: '501'
      publisher:
        '@type': Organization
        '@id': 'https://dxpr.com/#organization'
        name: DXPR
        url: 'https://dxpr.com/'
        logo:
          '@type': ImageObject
          url: 'https://dxpr.com/themes/custom/dxpr_com/dxpr-logo-dark.svg'
          width: '1348'
          height: '501'
      mainEntityOfPage: 'https://dxpr.com/zh-hans/hc/documentation/learn-dxpr-builder/troubleshooting/images-and-media'
      articleSection: 排查问题
    -
      '@type': WebPage
      '@id': 'https://dxpr.com/zh-hans/hc/documentation/learn-dxpr-builder/troubleshooting/images-and-media'
      description: 让上传正常工作并将上传文件保留在网站上。图像通过页面构建器自带上传到达页面，网站使用媒体库时则通过媒体库。大多数失败是媒体设置、文件权限或上传未到达服务器所致。
      breadcrumb:
        '@type': BreadcrumbList
        itemListElement:
          -
            '@type': ListItem
            position: 1
            name: 首页
            item: 'https://dxpr.com/zh-hans'
      publisher:
        '@type': Organization
        '@id': 'https://dxpr.com/#organization'
        name: DXPR
      inLanguage: zh-hans
---
[帮助中心](/zh-hans/node/75)/[文档](/zh-hans/hc/documentation) /[学习 DXPR Builder](/zh-hans/hc/documentation/learn-dxpr-builder) /[管理网站](/zh-hans/hc/documentation/learn-dxpr-builder/manage) /[排查问题](/zh-hans/hc/documentation/learn-dxpr-builder/troubleshooting) # 图像不上传或消失.

 学习 DXPR Builder管理网站排查问题

   ## 本指南内容

 相关指南

- [从媒体库放置图片](/zh-hans/hc/documentation/learn-dxpr-builder/integrations/media-library)

让上传正常工作并将上传文件保留在网站上。图像通过页面构建器自带上传到达页面，网站使用媒体库时则通过媒体库。大多数失败是媒体设置、文件权限或上传未到达服务器所致。

## 媒体浏览器缺失或打开为空

1. 前往 **DXPR Studio** &gt; **DXPR Builder** &gt; **General Settings**(`/admin/dxpr_studio/dxpr_builder/settings`），然后打开 **Media** 版块。
2. 设置 **Browser type** 为 **Media Library** 并点击 **Save settings**。该选项仅在核心 Media Library 模块启用时出现。选择 **Media Library (Acquia DAM)** 如果您使用 Acquia DAM。
3. 前往 **Structure** &gt; **Media types** 并检查机器名为以下内容的媒体类型 `image` 存在（`video` 视频）。页面构建器在该类型上打开媒体库。

**注意：** **Basic file upload** 显示普通 **Select image**直接从您的计算机上传的按钮。当 Media Library 未启用时默认使用它。Entity Browser 是旧选项；请优先使用 Media Library。

## 上传失败并出错

- **"Destination file path is not writable" or "File could not be saved".** Web 服务器无法写入文件目录。请 `sites/default/files` 对 Web 服务器用户可写，然后检查 **Reports** &gt; **Status report**.
- **"Only files with the following extensions are allowed".** 页面构建器接受 GIF、JPEG、PNG、WebP、AVIF 和 SVG 图像，以及 WebM、Ogg 和 MP4 视频。在 Media Library 中，媒体类型决定：在以下位置添加扩展名 **允许的文件扩展名** 图像字段的，位于 **Structure** &gt; **Media types** &gt; **Image** &gt; **Manage fields**.
- **"exceeding the maximum file size", or "The uploaded video is too large".** 文件大于 PHP 接受的大小。提高 `upload_max_filesize` 和 `post_max_size` PHP 方面，以及 Web 服务器或代理的正文大小限制。
- **403 或 405，位于 `/dxpr_builder/ajax/file_upload`.** 代理或防火墙阻止或重定向到该路径的 POST 请求。请将其加入允许名单，并确保网站不重定向它，例如从 HTTP 重定向到 HTTPS。
- **编辑人员在媒体浏览器中看到 "Access denied"。** 该角色需要 **View media** 以打开 Media Library，并 **Image: Create new media** 以在其中上传。在以下位置授予两者 **People** &gt; **Permissions**.

## 上传几小时后图像消失

文件从以下位置消失 `sites/default/files/dxpr_builder_images`且页面显示破损图像。

3.0.0-alpha85 之前的版本在 Media 模块关闭时将页面构建器上传保存为临时文件。Drupal 的 cron 六小时后删除临时文件。

1. 更新到当前版本。它将上传保存为永久文件并记录其使用。
2. 重新上传缺失的图像，或从备份恢复到同一文件夹。

**注意：** 上传到 `dxpr_builder_images`, `dxpr_builder_videos` 和 `dxpr_builder_files` 默认文件目录中。

## 图像在编辑器中显示但访客看不到

- **重新加载后图像消失。** 容器未保存。重新添加图像并点击 **Save** 在容器栏上。
- **您看到图像，访客看不到。** **Apply text format filters to frontend content** 在以下位置打开 **General Settings** &gt; **Text Filters**，字段的文本格式移除 `img` 标签或其属性。编辑人员始终看到未过滤的内容。关闭设置，或允许 `img` 该文本格式中。
- **访客看到旧版页面。** 缓存提供的是旧页面。参见 [访客看到不同内容](/zh-hans/hc/documentation/learn-dxpr-builder/troubleshooting/visitors-see-something-else)。

## 确认修复

上传图像到 Image 元素并保存容器。在隐私窗口中图像对匿名访客显示。

## 接下来做什么？

[Media Library integration](/zh-hans/hc/documentation/learn-dxpr-builder/integrations/media-library)在页面构建器中复用现有媒体。