I want to get the absolute path I uploaded, but I only get the file name and template file! How can I obtain the absolute path of my upload. Reply to discussion (solution)
What is the relationship with the absolute path on the uploaded machine?You
Php obtains the file type of the uploaded file name. Php Tutorial: get the file type of the uploaded file name $ imgname $ _ FILES [file] [name]; get the name of the uploaded file $ filetypepathinfo ($ imgname, PATHINFO_EXTENSION ); get the suffix $
When uploading a file, you need to specify the path of the upload file, however, if the face of a large number of users upload different files, it will inevitably have the same name, which will cause file replacement, resulting in the loss of files,
Use plupload upload image, want to upload the image address to write to the database, ask how to get the file name of uploading pictures in the background. Thanks a lot!
Reply to discussion (solution)
Not used, but the contents of
1, Mime_content_type () function to judge get file type
Mime_content_type returns the MIME type of the specified file.
Usage:
The code is as follows
Copy Code
Echomime_content_type (' Php.gif '). " n ";Echomime_content_
PHP implements file upload and multi-file upload ,. PHP implements file upload and multi-file upload. in PHP program development, file upload is a very common function and one of the essential skills of PHP programmers. It is worth noting that file
: This article mainly introduces php programming notes. if you are interested in PHP tutorials, please refer to them. Three methods for php to obtain POST data
Php image watermarking source code
Php + ajax + json is the simplest example.
Php Chinese
Php Tutorial: get the file type of the uploaded file name
$ Imgname = $ _ FILES ["file"] ["name"]; // get the name of the uploaded file$ Filetype = pathinfo ($ imgname, PATHINFO_EXTENSION); // get the suffix$ Newname = date ("Ymdhis"). ".". $
Php programming notes-three methods for obtaining POST data from small_123 php
Php image watermarking source code
Php + ajax + json is the simplest example.
Php Chinese character to pinyin source code
Php traverses the Directory, generates the md5
Almost every website has the file upload function. the file upload function is essential to almost all websites. However, this function is highly risky for servers, we restrict the size and type of the uploaded file. we can obtain the suffix of the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.