Comments (7)
Hi,
thanks for pointing out this error, it was very useful for finding a general error on multipart datas that I'll fix soon.
I've just released a fix for your specific case, let me know if it solves.
from php-mattermost-driver.
Many thank!. it worked. but can I ask you one more questions?
How can I generate client_ids? The upload File API is required client_ids
from php-mattermost-driver.
so I have to change it
$option = [
[
'name' => 'channel_id',
'contents' => empty($requestOptions['channel_id']) ? null : $requestOptions['channel_id'],
],
[
'name' => 'files',
'filename' => empty($requestOptions['filename']) ? null : $requestOptions['filename'],
'contents' => empty($requestOptions['files']) ? null : $requestOptions['files'],
]
];
if (isset($requestOptions['client_ids'])) {
$option[] = [
'name' => 'client_ids',
'content' => $requestOptions['client_ids']
];
}
return $this->client->post(self::$endpoint, $option, RequestOptions::MULTIPART);
(client_ids is not required)
from php-mattermost-driver.
Hi,
I'm not sure I understood your question, the client_ids
param is not required and you can call the uploadFile
method without passing it
$result = $driver->getFileModel()->uploadFile([
'channel_id' => '123bcff45',
'filename' => 'test.jpg',
'files' => fopen('/path/to/the/file', 'rb'),
]);
Is there something wrong with this?
from php-mattermost-driver.
Yes, It is not required
But I get an error
from php-mattermost-driver.
Oh, you're absolutely right. I'm sorry for this inconvenience.
I've just released the fix, please let me know if you notice anything else.
Thanks.
from php-mattermost-driver.
Thank you. It worked perfectly
from php-mattermost-driver.
Related Issues (20)
- Join forces on MattermostAPI client? HOT 3
- Message with File Attached HOT 8
- " Class 'Pimple\Container' not found" HOT 1
- Can't use search in channel ! HOT 6
- Methods to manage icons HOT 4
- Returns 500 HOT 4
- Laravel 7 support? HOT 2
- Preferences model are locked to single user because of model caching HOT 7
- Support limit_after and limit_before parameters in request to get posts around oldest unread HOT 3
- With https:// in the beginning 500 error and without nothing happens HOT 5
- Laravel 7 Support HOT 2
- guzzle 7.x support HOT 1
- Missing Endpoints in ReactionModel? HOT 2
- Endpoint for custom user status HOT 1
- Fatal error: Declaration of Illuminate HOT 8
- Guzzle HOT 2
- Decouple from Pimple HOT 5
- Add optional permanent=true to user and channel delete HOT 1
- Api function
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-mattermost-driver.