We help IT Professionals succeed at work.

Javascript code not working assistance needed

error77
error77 asked
on
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.

Thanks


<html>
<head>
<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() {

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

</head>
<body>




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

</body>
</html>

Open in new window

Comment
Watch Question

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

Author

Commented:
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.

Thanks

Author

Commented:
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)

Author

Commented:
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.