php - blueimp jquery upload SyntaxError: Unexpected token < [SOLVED] -
php - blueimp jquery upload SyntaxError: Unexpected token < [SOLVED] -
i'm using jquery library blueimp upload. want upload images different directory. modified /server/php/index.php file (only file) :
error_reporting(e_all | e_strict); require_once('uploadhandler.php'); //$upload_handler = new uploadhandler(); define(dir_download, "/applications/xampp/htdocs/villalba2"); define(http_server, "localhost/villalba2"); $blogid= "mobiliario"; $upload_handler = new uploadhandler(array( 'upload_dir' => dir_download . '/uploads/' . $blogid. '/', 'upload_url' => http_server . '/uploads/' . $blogid. '/', ));
the permission folder 777
the images loaded correctly in directory want, error:
chrome ->syntaxerror: unexpected token < safari ->syntaxerror: json parse error: unrecognized token '<'
the result of /server/php/index.php is:
<b>notice</b>: utilize of undefined constant dir_download - assumed 'dir_download' in <b>/applications/xampp/xamppfiles/htdocs/villalba2/up/server/php/index.php</b> on line <b>16</b><br /> <br /> <b>notice</b>: utilize of undefined constant http_server - assumed 'http_server' in <b>/applications/xampp/xamppfiles/htdocs/villalba2/up/server/php/index.php</b> on line <b>17</b><br /> {"files":[{"name":"cama (1).jpg","size":101775,"url":"localhost\/villalba2\/uploads\/mobiliario\/cama%20%281%29.jpg","thumbnailurl":"localhost\/villalba2\/uploads\/mobiliario\/thumbnail\/cama%20%281%29.jpg","deleteurl":"http:\/\/localhost\/villalba2\/up\/server\/php\/?file=cama%20%281%29.jpg","deletetype":"delete"},{"name":"cama (2).jpg","size":101775,"url":"localhost\/villalba2\/uploads\/mobiliario\/cama%20%282%29.jpg","thumbnailurl":"localhost\/villalba2\/uploads\/mobiliario\/thumbnail\/cama%20%282%29.jpg","deleteurl":"http:\/\/localhost\/villalba2\/up\/server\/php\/?file=cama%20%282%29.jpg","deletetype":"delete"},{"name":"cama (3).jpg","size":101775,"url":"localhost\/villalba2\/uploads\/mobiliario\/cama%20%283%29.jpg","thumbnailurl":"localhost\/villalba2\/uploads\/mobiliario\/thumbnail\/cama%20%283%29.jpg","deleteurl":"http:\/\/localhost\/villalba2\/up\/server\/php\/?file=cama%20%283%29.jpg","deletetype":"delete"},{"name":"cama.jpg","size":101775,"url":"localhost\/villalba2\/uploads\/mobiliario\/cama.jpg","thumbnailurl":"localhost\/villalba2\/uploads\/mobiliario\/thumbnail\/cama.jpg","deleteurl":"http:\/\/localhost\/villalba2\/up\/server\/php\/?file=cama.jpg","deletetype":"delete"},{"name":"mantelera.jpg","size":50986,"url":"localhost\/villalba2\/uploads\/mobiliario\/mantelera.jpg","thumbnailurl":"localhost\/villalba2\/uploads\/mobiliario\/thumbnail\/mantelera.jpg","deleteurl":"http:\/\/localhost\/villalba2\/up\/server\/php\/?file=mantelera.jpg","deletetype":"delete"},{"name":"test (1).png","size":15,"url":"localhost\/villalba2\/uploads\/mobiliario\/test%20%281%29.png","deleteurl":"http:\/\/localhost\/villalba2\/up\/server\/php\/?file=test%20%281%29.png","deletetype":"delete"},{"name":"test (2).png","size":15,"url":"localhost\/villalba2\/uploads\/mobiliario\/test%20%282%29.png","deleteurl":"http:\/\/localhost\/villalba2\/up\/server\/php\/?file=test%20%282%29.png","deletetype":"delete"},{"name":"test.png","size":15,"url":"localhost\/villalba2\/uploads\/mobiliario\/test.png","deleteurl":"http:\/\/localhost\/villalba2\/up\/server\/php\/?file=test.png","deletetype":"delete"}]}
why dosen't work?? images upload in right folder :s
thanks!
---this lastly part solved-----
edit:
now the thumbs not displayed on browser..
failed load resource: server responded status of 404 (not found) /localhost/villalba2/up/localhost/villalba2/uploads/mobiliario/thumbnail/mbiliario.jpg
the right absolute path be:
/localhost/villalba2/uploads/mobiliario/thumbnail/mbiliario.jpg
the path: /localhost/villalba2/up/ blueimp jquery upload core
you must utilize quotes when define constant
define('dir_download', "/applications/xampp/htdocs/villalba2");
then json output parsable
php jquery json image-uploading blueimp
Comments
Post a Comment