简体   繁体   中英

How to fix the upload server in jquery file upload with codeigniter?

i'm try to make a images file uploader using jquery file upload and codeigniter, all things are good until i have to upload a file i use chrome to inspict the error it's show me that he can't fin the upload server

$('#fileupload').fileupload({
    // Uncomment the following to send cross-domain cookies:
    //xhrFields: {withCredentials: true},
    url: 'server/php/'
});

in the end how to fix it thanks

for calling the path use base_url or site_url before the file path.

for example,

url:'<?php echo site_url;?>/server/php/'

try this and reply me.

server/php must be replaced by the controller name that contains the statement to load the uploadhandler.php file as a library or by the controller followed by the method name.

Using the tutorial in the documentation , you configure

url: 'fileupload/'

If the upload form is on a page generated by another controller, that is, in a method of another controller, then note that

http://example.com/[controller-class]/[controller-method]/

[controller-class] can be configured to have several breaks per "/" as /example1/example2/examle3/. Then you must go up the hierarchical level to access the method correctly:

url: '../../../fileupload/'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM