Home Backend Development PHP Tutorial Uploadify3.1下传5M以下文件显示成功,实际没下传成功

Uploadify3.1下传5M以下文件显示成功,实际没下传成功

Jun 13, 2016 pm 01:18 PM
file files php

Uploadify3.1上传5M以上文件显示成功,实际没上传成功
PHP Uploadify3.1上传4M多的可以上传成功,上传大点的,进度条和提示都显示成功,但实际文件没上传成功,调试环境IIS6
,可以确认路径没问题,操作应该也没问题,是不是uploadify本身不能上传大文件?还有没有其他好的上传大文件的PHP插件介绍。
JS代码如下

JScript code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->$(function() {
        $('#file_upload').uploadify({
            'swf'      : 'uploadify.swf',
            'uploader' : 'uploadify.php',
            'buttonText':'上传',
            'auto'     : false,
            'height': 24,
            'width': 50,
            'cancelImage': 'uploadify-cancel.png',
            'checkExisting':'check-exists.php',
            'multi':false,
            'fileDataName': 'Filedata',
            'fileTypeDesc': 'FLV视频文件和图片文件',
            'fileTypeExts':'*.flv;*.jpg;*.iso',
            'onUploadError' : function(file,errorCode,errorMsg,errorString,swfuploadifyQueue){
                alert(errorMsg);//上传文件出错是触发(每个出错文件触发一次)
            },
            'onUploadSuccess':function(file,data,response){
              alert( 'id: ' + file.id+ ' - 索引: ' + file.index+ ' - 文件名: ' + file.name + ' - 文件大小: ' + file.size+ ' - 类型: ' + file.type+ ' - 创建日期: ' + file.creationdate+ ' - 修改日期: ' + file.modificationdate+ ' - 文件状态: ' + file.filestatus + ' - 服务器端消息: ' + data+ ' - 是否上传成功: ' + response);



            }
            // Your options here
        });
    });
Copy after login


PHP上传文件uploadify.php代码如下
PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->$targetFolder = '/uploads'; // Relative to the root

if (!empty($_FILES)) {
    $tempFile = $_FILES['Filedata']['tmp_name'];
    $targetPath = $_SERVER['DOCUMENT_ROOT'] . $targetFolder;
    $targetFile = rtrim($targetPath,'/') . '/' . $_FILES['Filedata']['name'];
    
    // Validate the file type
    $fileTypes = array('jpg','jpeg','gif','png','flv','iso'); // File extensions
    $fileParts = pathinfo($_FILES['Filedata']['name']);
    
    if (in_array($fileParts['extension'],$fileTypes)) {
        move_uploaded_file($tempFile,$targetFile);
        echo '1';
    } else {
        echo 'Invalid file type.';
    }
}
Copy after login




------解决方案--------------------
不是程序就是环境限制了上传大小
------解决方案--------------------
探讨

大哥可否说详细点 这个上传不上分块上传的吗?
如果不上分块的 估计肯定是上传不了的

------解决方案--------------------
if (!empty($_FILES)) {
if($_FILES['Filedata']['error'] != 0) die('错误号:' . $_FILES['Filedata']['error']);
$tempFile = $_FILES['Filedata']['tmp_name'];
....
------解决方案--------------------
php.ini设置max_post_size大于等于5m就行了
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

CakePHP Project Configuration CakePHP Project Configuration Sep 10, 2024 pm 05:25 PM

In this chapter, we will understand the Environment Variables, General Configuration, Database Configuration and Email Configuration in CakePHP.

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

CakePHP Date and Time CakePHP Date and Time Sep 10, 2024 pm 05:27 PM

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

CakePHP File upload CakePHP File upload Sep 10, 2024 pm 05:27 PM

To work on file upload we are going to use the form helper. Here, is an example for file upload.

CakePHP Routing CakePHP Routing Sep 10, 2024 pm 05:25 PM

In this chapter, we are going to learn the following topics related to routing ?

Discuss CakePHP Discuss CakePHP Sep 10, 2024 pm 05:28 PM

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

How To Set Up Visual Studio Code (VS Code) for PHP Development How To Set Up Visual Studio Code (VS Code) for PHP Development Dec 20, 2024 am 11:31 AM

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

CakePHP Creating Validators CakePHP Creating Validators Sep 10, 2024 pm 05:26 PM

Validator can be created by adding the following two lines in the controller.

See all articles