In the official thinkphp example, if the image uploaded by file is not saved in Upload, I will create a database & nbsp; configure the database & nbsp; the previous curd & nbsp; ajax & nbsp; forms available & nbsp; When uploading files & nbsp; displayed successfully & nbsp; however, no images are saved under Upload. & in the official thinkphp example, the files uploaded images cannot be saved in Upload.
After I set up the database, the curd ajax form before the database is configured can be used to Upload files. it is displayed as successful, but the image is not saved under Upload. why? Is there a problem?
D: \ wamp \ www \ file \ Uploads:
Import ('@. ORG. uploadfile ');
// Import Upload class
$ Upload = new UploadFile ();
// Set the size of the uploaded file
$ Upload-> maxSize = 3292200;
// Set the Upload file type
$ Upload-> allowExts = explode (',', 'jpg, gif, png, jpeg ');
// Set the attachment Upload Directory
$ Upload-> savePath = './Uploads /';
// Set the thumbnail to be generated, which is only valid for image files
$ Upload-> thumb = true;
// Set the path of the referenced image library package
$ Upload-> imageClassPath = '@. ORG. image ';
// Set the file suffix for generating thumbnails
$ Upload-> thumbPrefix ='m _, s _ '; // produce two thumbnails.
// Set the maximum width of the thumbnail.
$ Upload-> thumbMaxWidth = '000000 ';
// Set the maximum height of the thumbnail.
$ Upload-> thumbMaxHeight = '000000 ';
// Set file Upload rules
$ Upload-> saveRule = 'uniqid ';
I haven't made any other changes. Why can't I show images?
Novice
------ Solution --------------------
Is your project in D: \ wamp \ www \ file?
Confirm that D: \ wamp \ www \ file \ Uploads has full control of general users.
Check whether "archive allowed" of D: \ wamp \ www \ file \ Uploads is selected.
------ Solution --------------------
/*
File Upload
*/
Function up ()
{
Import ("@. ORG. UploadFile ");
$ Upload = new UploadFile ();
$ Upload-> maxSize = 10*500*1024;
$ Upload-> thumb = false;
$ Upload-> autoSub = true;
$ Upload-> hashLevel = 2;
$ Upload-> subType = "date ";
$ Upload-> dateFormat = "Ymd ";
$ Upload-> saveRule = "uniqid ";
$ Upload-> uploadReplace = false;
$ Upload-> allowExts = explode (',', 'PNG, jpg, jpeg, gif ');
$ Upload-> savePath = C ('image _ upload ');
If ($ upload-> upload ()){
$ Info = $ upload-> getUploadFileInfo ();
// Dump ($ info); exit;
Return $ info;
} Else {
$ This-> error ($ upload-> getErrorMsg ());
}
}
'Image _ upload' => '/DATA/html/EMS/thumb /'
This is the path
The file cannot be uploaded, not the file itself. The permission issue is to check whether the directory you want to upload has the permission.