plupload文件名问题 [英] Plupload filename problem

查看:319
本文介绍了plupload文件名问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里要求,是希望一些成员熟悉'plupload'来提供帮助. 这个小巧的Jquery脚本正在解决我的文件上传问题,因此,我们将不胜感激.

I ask here in the hope that some members will be familiar enough with 'plupload' to help. This little Jquery script is on the way to making my file-upload problems go away, so any help would be greatly appreciated.

问题: 我可以使用plupload上传大文件,但是当服务器上显示的名称更改为乱码时,

Question: I can upload large files using plupload, but when the appear on the server the name has changed to gibberish,

EG p163g1k1er15n310bi18bq1af61rc21.zip

根据我对基本上传格式的经验,我的假设是写出临时文件名,目的是在将分块部分放回原处时将其重命名为原始文件名,但是由于某些原因,它可能没有做这个.

From my experience with basic upload forms my assumption is that it is writing out a temp filename with the intention of renaming it to the original filename when the chunked sections have been put back together, but for some reason it may not be doing this.

我已将文件夹的权限更改为777,所以我有理由确定这不是问题.

I have changed the permission on the folder to 777, so I'm reasonably sure this isn't the issue.

正在使用的运行时是Flash(我需要分块功能).它是1.4.3.2版

The runtime being used is Flash (I require the chunking feature). It's version 1.4.3.2

一如既往,任何帮助将不胜感激.

As always, any help would be much appreciated.

推荐答案

有一个配置选项可以生成唯一的文件名,而不使用实际的文件名.

There is a configuration option to generate unique file names instead of using the actual file name.

文档:

唯一名称 上载时生成唯一的文件名.这会产生不规律 文件的文件名,以便它们 例如不要与 服务器上已有的.

unique_names Generate unique filenames when uploading. This will generate unqiue filenames for the files so that they don't for example collide with existing ones on the server.

确保在您的配置中未启用此选项(默认情况下未启用).仍有一些文件名清除例程由默认包含的php上传脚本运行...

Make sure this option is not enabled in your configuration (it is not by default). There are still some file name cleaning routines run by the default included php upload script...

// Clean the fileName for security reasons
$fileName = preg_replace('/[^\w\._]+/', '', $fileName);

...并且如果文件存在(无论配置如何),下划线总是附加一个数字,例如filename_2.jpg,但是除此之外,它不应该更改您的文件名.

...and an underscore is always appended with a number if the file exists (regardless of configuration), like filename_2.jpg, but aside from that it should not be altering your file names.

编辑:我一直在搜索论坛对于解决方案,但很快,我的最后一条建议是尝试HTML5运行时,以查看它是否与Flash运行时相关,因为

EDIT: I've been searching the forums for a solution but coming up short, my last piece of advice is to try the HTML5 runtime, to see if this is related to the Flash runtime somehow, as there have been some issues with previous versions. If all else fails, post on the forum - the admins there are very responsive. Best of luck, please post a solution here if you find it.

这篇关于plupload文件名问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆