It looks like you're new here. If you want to get involved, click one of these buttons!
<li>
<label>Imagen<span class=\"small\">Imagen en formato JPG o PNG menor de 200kb.</span></label>
<input id=\"fileUpload\" name=\"fileUpload\" type=\"file\" />
<script type=\"text/javascript\">// <![CDATA[
$('#fileUpload').uploadify({
'uploader': '../js/uploadify/uploadify.swf',
'script': '../js/uploadify/uploadify.php',
'folder': '../images/uploads',
'checkScript': '../js/uploadify/checkscript.php',
'cancelImg': 'cancel.png',
'fileDesc': 'Imágenes .jpg, .png',
'fileExt': '*.jpg;*.png',
'auto':true,
'sizeLimit': 200000,
'onComplete': function(event, queueID, fileObj, response, data) {
$('div#archivos').append(\"- <b>\" + response + \"</b> <span style='color: green;'>ok!</span><br />\");
//$('div#archivos').append(fileObj.name + \" ok!<br />\");
$('#uploadhidden').val($('#uploadhidden').val() +response+ ',');}
});
// ]]></script>
<!-- <a href=\"javascript:$('#fileUpload').uploadifyUpload();\">Upload Files</a> -->
</li>
<input name=\"uploadhidden\" type=\"hidden\" id=\"uploadhidden\" />
<div id=\"archivos\"></div>
lachojr said:Thanks a lot to both of you for the quick response. It worked!!
I´m still playing with the script.
I'm trying to build an app that when you upload:
1. Check if the file exists
2. If it exist just rename it an store the file name in the hidden input
3. Finish by submitting everything in the form to a DB
I've read a lot of the stuff others wrote about this, but still can't find one that I actually understand to rename the file.
Could you guys point me to the right direction please?
Thanks
echo $filename;
echo $_FILES['Filedata']['name'];
'checkScript': '../js/uploadify/checkscript.php',
$('#id').uploadifyUpload();
'onComplete': function(event, queueID, fileObj) { SaveToDB(fileObj.name); },function SaveToDB(uploadName)
{
// do ajax thing here
}
Jay Jennings said:Oops, sorry about that -- I pass in the new name to my upload script so I don't *have* to keep track of it. I just grab the name when it comes back and modify it again before I save it.
But I just went and looked at the docs and it doesn't say anything about what's in response when it comes back. Anybody know where that's documented? Or is that just whatever's echo'd from the server script?
Jay Jennings