If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Yes, that is right, with javascript the files must be sent to the server side in order to be managed. The reason is that javascript cannot interact with the user filesystem, because of security reasons. If this would be possible, some malicious programmer could easily access every user filesystem, what could become terrible.

And that is the reason because the browsers don't have that technologies by default. If a user wish to install them, it is their responsibility.

Yes, that is right, with javascript the files must be sent to the server side in order to be managed. The reason is that javascript cannot interact with the user filesystem, because of security reasons. If this would be possible, some malicious programmer could easily access every user filesystem, what could become terrible.

And that is the reason because the browsers don't have that technologies by default. If a user wish to install them, it is their responsibility.

I agree that Javascript cannot interact with the filesystem. I was saying your blanket statement that Javascript cannot manipulate individual POST elements was misleading and didn't want others to be confused.

than, I'm not realy confident with JS. I understand the way the script is running but I really don't get how to do it with more uploads.
You reffer to the Iframe uploadedImage to show the preview but how can I upload more files and show all previews to the client??

Thanks for the great plugin. This is exactly what I am looking for. Btw I have try to modify the code to enable 3 type of images resize but am having some problem in doing it. Could any pls help me on this?

Thanks for the fast reply. Actually I am thinking of creating more images size, currently your plugin only created 2 type of size that is the 'Thumbnail' and the 'Medium' size. How could I do so if I need to create another size? That mean a total of 3 sizes 'Thumbnail', 'Medium' and 'Large'?

For your information, I have modify some of your code and successfully generated the 3 type size in the temporary folder but the 'Large' size just failed to be moved from the temp folder to the 'Large' folder when I save it. Pls refer to the 'function moveTempFileDescriptiveName' which I have modified as below.

// if the file already exists in the target path, it must be deleted
// or there will be an error when moving a file with the same name.
// Ideally, all the names are unique, and no file will be moved with
// the same name as another that already is there
unlink($targetFilePathname);
}
if ( ! rename($tempFilePathname, $targetFilePathname)) {
$probablyUniqueFilename = null;
} elseif (file_exists($targetFilePathname1)){{

How can I change the $uploadFilenames name from the current one that using the 'Keyword' to something like

$uploadFilenames = microtime(true) . $sessionid; or something like

hash_file('sha256', $filePath)

We are actually working on an uploading site that we need to make sure all of the images file name stored in the folder must be unique to each other.

A unique filename is generate by the function uploadedFile.php > getDescriptiveUniqueFilename(). A filename is generated with the given keywords. Three of these keywords are randomly taken, and, if the filename already exists, a unique filename is generated with the temp filename that php generated to upload the file. The code is at the end of the named function:

It is 99% secure, but if you want to improve the algorithm, the getDescriptiveUniqueFilename() function is the place.

Originally Posted by SpitFire11

The last question would be how could I store the path for each of the uploaded and saved images to the mysql database.

The insert.php script calls to UploadedFile::moveTempFilesDescriptiveNames() and stores the uploaded paths in the $savedImages array. You could then pass that array to a function that inserts the paths into a database.

I did search for the syntax to pass the the $savedImages array to a function as per mentioned but I just couldn't find it. Could you help to show me a simple syntax to pass the array to a function.

Thanks again and sorry for my ignorance.

The insert.php script calls to UploadedFile::moveTempFilesDescriptiveNames() and stores the uploaded paths in the $savedImages array. You could then pass that array to a function that inserts the paths into a database.