Muy bien gracias, Yo hablo espaņol tambien. Yo tome una ruta diferente para guardar las imagenes en la base de datos. Utilizo la funcion encontrada en saved.php para buscar el valor de $images y salvarlo finalmente en la base de datos.
Amigo AMS donde estas?
I know you have been busy. Please help me out with one last request. This about the preview images: Under every upload input a preview image appears. Is there a way I can have a second copy of the preview images appear somewhere else in the page but not with an upload input above? Hope this makes sense.
Hi AMS, i think the problem is in the function getPath of configuration.php because if i put the path of the images folder, works fine.
Example:
PHP Code:public static function deleteUploadedFiles($filenames) {
$resultOk = true;
foreach($filenames as $filename) {
if ($filename) {
$resultOk = $resultOk && self::deleteUploadedFile($filename);
}
}
return $resultOk;
}
// ---------------------------------------------------------------------------
/**
* Delete the given uploaded file.
*
* @param string $filename
* @return $resultOk
*/
public static function deleteUploadedFile($filename) {
$resultOk = false;
$uploadPath = '../uploads/medium/';
$tmbUploadPath = '../uploads/thumb/';
if ( ! $filename) {
$resultOk = true;
}
else {
if (file_exists($uploadPath . $filename)) {
if (unlink($uploadPath . $filename)) {
if (file_exists($tmbUploadPath . $filename)) {
if (unlink($tmbUploadPath . $filename)) {
$resultOk = true;
}
}
}
}
}
return $resultOk;
}
And if i try to delete more than one image, only delete the last one.
Many thanks!!!
Hi AMS! Well, i found the solution for non deleted files, in the function deleteUploadedFiles. Is necesary to remove "$resultOk = $resultOk &&" before self::deleteUploadedFile($filename); and work it!
But now i cant found a solution in configuration.php functions for the images path.
Thanks!!!PHP Code:public static function deleteUploadedFiles($filenames) {
$resultOk = true;
foreach($filenames as $filename) {
if ($filename) {
$resultOk = $resultOk && self::deleteUploadedFile($filename);
}
}
return $resultOk;
}
Great script AMS, exactly what I was looking for from weeks.
Just a request: is it possible to show the file name somewhere after selected the image? The most annoying issue in all upload image forms is that the long path to picture in the input area always hide the file name: you have to scroll the path to the right to check the filename.
One more thing: if I remove a selected image not yet saved, the path still stay in the input field, could it be removed?
Hi AMS! Now i have the form fully working and i add a form validator, but i have the last question. It is posibble to send the form without images? in my form the images are optional. I remove the "length" line in itemform.js - function validateData() - if (( ! $.uploaderPreviewer.loadedImages().length) and now i can send the form without images but i cant remove the alert message of no images added. Can you say me how to remove this alert message?
Many thanks!!!
Hello AMS!!!
Many thanks for this script, is perfect but only have one problem. The script dont work with form, if i use a <form></form> when i press submit button don´t save the content. Any idea for me, how to repair? Is necesary a <form> to validate data.
Thanks for your help
Hi there
Does anybody can solve Tom's question?
Script is really great but it would be more great to use it with common <form></form> tags.
Or please describe how to make a full-sized form with several fields using script's workaround.
In its initial state there is only one "Other field:" which is transferring through GET request.
Regards