Link to home
Create AccountLog in
Avatar of error77
error77

asked on

Javascript code not working assistance needed

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

Avatar of dexion432
dexion432

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

ASKER

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
Avatar of error77

ASKER

I'm using this BTW:

<script src="http://code.jquery.com/jquery-1.6.4.min.js" type="text/javascript"></script>
ASKER CERTIFIED SOLUTION
Avatar of dexion432
dexion432

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of error77

ASKER

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