简体   繁体   English

seafile php文件上传

[英]seafile php file upload

I have created a basic CRM system using CodeIgniter in PHP and are making use of Seafile-Serve Web API to store and retreive files locate on the same server that hosts the CRM. 我已经使用PHP中的CodeIgniter创建了一个基本的CRM系统,并且正在使用Seafile-Serve Web API来存储和检索位于托管CRM的同一服务器上的文件。 The following is a function I created to upload existing files to seafile using the post method defined in the api manual: https://manual.seafile.com/develop/web_api.html#upload-file-1 以下是我创建的用于使用api手册中定义的post方法将现有文件上传到seafile的功能: https ://manual.seafile.com/develop/web_api.html#upload-file-1

public function uploadFile($upload_link, $upload_file, $upload_filename){
    return $this->decode($this->post($upload_link,
        array(
            'file'  => new Curlfile('test.txt'),
            'filename'  => "test.txt",
            'parent_dir' => "/"
        )
    ));
}

Can I perhaps ask that someone point out the various things I am doing wrong? 我也许可以问别人指出我做错的各种事情吗?

Well, a lot of thing could be happening... did you tried to put new Curlfile('test.txt') into a separated variable and then var_dump / die() it to see if the file is really being "loaded" correctly? 好吧,可能发生了很多事情……您是否尝试过将new Curlfile('test.txt')放入一个单独的变量中,然后通过var_dump / die()来查看文件是否确实在“正确加载” ? Also, are you passing the absolute path to that file? 另外,您是否将绝对路径传递给该文件?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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