We help IT Professionals succeed at work.

Javascript code not working assistance needed

error77 asked
Hi all,

I am trying to get Uploadify to work but when I click the button to open the window that selects the files, nothing happens.

I was wondering if anyone can spot any potential problems in the code attached below.


<link href="/uploadfilesfolder/uploadify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/uploadfilesfolder/swfobject.js"></script>
<script type="text/javascript" src="/uploadfilesfolder/jquery.uploadify.min.js"></script>

<script type="text/javascript">
jQuery(document).ready(function() {

        'uploader'  : '/uploadfilesfolder/uploadify.swf',
        'script'    : '/uploadfilesfolder/uploadify.php',
        'cancelImg' : '/uploadfilesfolder/cancel.png',
        'folder'    : '<?php echo($_SERVER['DOCUMENT_ROOT']."/uploads/images") ?>',
        'auto'      : true


<input id="file_upload" type="file" name="Filedata" />
<p><a href="javascript:$('#file_upload').uploadifyUpload();">Upload Files</a></p>


Open in new window

Watch Question

jquery js include is missing, you are including only jquery.uploadify.min.js


Sorry, I forgot to mention...I've got it included, just not in attached code as I wanted to just have the uploadify stuff.

All scripts are successfully included in the page too ... I've checked that.



I'm using this BTW:

<script src="http://code.jquery.com/jquery-1.6.4.min.js" type="text/javascript"></script>
check whether the  jQuery(document).ready method runs properly ( put an alert box to the end of the function)


OK, got it to open but not uploading the file.

On uploadify.php I've set the rootfolder to '/'

and on the javascript I've set an absolute path to the image folder but nothing's happening...

No errors but no file uploaded.

check your post whether file content is sent to the server and check access rights and do some debug output in the upload process

Explore More ContentExplore courses, solutions, and other research materials related to this topic.