Welcome To b2b168.com, Join Free | Sign In
中文(简体) |
中文(繁體) |
Francés |Español |Deutsch |Pусский |
| No.13678386

- Product Categories
- Friendly Links
Information Name: | How to achieve wordpress upload files automatically renamed |
Published: | 2015-03-23 |
Validity: | 3000 |
Specifications: | |
Quantity: | 10000.00 |
Price Description: | |
Detailed Product Description: | Many built using wordpress blog friends will find, wp default in the file upload will not change the file's original name, so that sometimes leads us directly after uploading files may cause Chinese garbled file names or other problem, if the attachment is saved in the same directory, it may cause duplicate file names are overwritten. So how to achieve wordpress upload files automatically rename it? Here to talk to you. Operation: wordpress procedures found in wp-admin / includes / directory file.php file and edit it, locate the following code in about 327 lines: // Move the file to the uploads dir $ new_file = $ uploads ['path '.] "/ $ filename"; if (false === @ move_uploaded_file ($ file [' tmp_name '], $ new_file)) return $ upload_error_handler ($ file, sprintf (__ (' The uploaded file could not be moved to .% s'), $ uploads ['path'])); replace it: // Move the file to the uploads dir $ new_file = $ uploads ['path'] "/".date("YmdHis". ) .floor (microtime () * 1000) $ ext. ".";. if (false === @ move_uploaded_file ($ file ['tmp_name'], $ new_file)) return $ upload_error_handler ($ file, sprintf (__ ( 'The uploaded file could not be moved to% s.'), $ uploads ['path'])); PS: the whole code is actually replace the "/ $ filename"; overwrite the original file after saving, then upload it will be "the date when the minutes and seconds + kilobits millisecond integer" format to rename files, such as the "20121023122221765.jpg" Macau: http: //www.redta.com/aomenduchang/ |
Admin>>>
You are the 6790 visitor
Copyright © GuangDong ICP No. 10089450, Anqing day help Electronic Technology All rights reserved.
Technical support: ShenZhen AllWays Technology Development Co., Ltd.
AllSources Network's Disclaimer: The legitimacy of the enterprise information does not undertake any guarantee responsibility
You are the 6790 visitor
Copyright © GuangDong ICP No. 10089450, Anqing day help Electronic Technology All rights reserved.
Technical support: ShenZhen AllWays Technology Development Co., Ltd.
AllSources Network's Disclaimer: The legitimacy of the enterprise information does not undertake any guarantee responsibility