Comments (5)
@seratch do you know anything I am missing in the .zip upload process?
from java-slack-sdk.
Hi @oppokui, thanks for asking the question. The following code works for me without any issues:
FilesUploadV2Response response = Slack.getInstance().methods(botToken).filesUploadV2(r -> r
.file(new java.io.File("./test.zip"))
.title("test.zip")
.filename("test.zip")
.channel(channelId)
.initialComment("Here you are :wave:")
);
![](https://private-user-images.githubusercontent.com/19658/333757090-2cdba3c0-e709-4973-af18-4b6796a7fc54.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE2MTA2MDMsIm5iZiI6MTcyMTYxMDMwMywicGF0aCI6Ii8xOTY1OC8zMzM3NTcwOTAtMmNkYmEzYzAtZTcwOS00OTczLWFmMTgtNGI2Nzk2YTdmYzU0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzIyVDAxMDUwM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM2YmEzYWE5ZWVhOWQ1MzdmMDNhNDEwMjljYzA1NTE3MDY0NjFlNWQ0OWE0ZDA5MzA3MTZmYzBjMDRmZjA4MjMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.xwGyDTcTI_gF08pPI_rsGgmAw8riOkM6jdTizmGHjcA)
If your uploaded file is invalid, it could be caused by file access issue or data corruption. I hope you'll figure the cause out soon.
from java-slack-sdk.
Thanks, @seratch
Is it a bug of uploading multi files?
The following code doesn't work for .zip file (but works for .png file):
FilesUploadV2Request.UploadFile uploadFile = new FilesUploadV2Request.UploadFile();
uploadFile.setFile(file);
uploadFile.setFilename(filename);
uploadFile.setTitle(filename);
uploadFile.setAltTxt(desc);
uploadFiles.add(uploadFile);
FilesUploadV2Request request = FilesUploadV2Request.builder().uploadFiles(uploadFiles)
.token(boltToken).channel(channelId).build();
If I change to upload one file as you show in the example code, it works for .zip:
FilesUploadV2Request request = FilesUploadV2Request.builder().file(file).filename(filename)
.title(filename)
.token(boltToken).channel(channelId).build();
from java-slack-sdk.
Ah I see. Since it’s Saturday for me, I will check the issue early next week. Thanks for reporting the issue and we’re sorry about the inconvenience.
from java-slack-sdk.
@seratch , no problem. Happy weekend!
from java-slack-sdk.
Related Issues (20)
- Request for Exact Size Limit of Timestamp (ts) Field in Java Slack SDK HOT 2
- Use the slack huddle api HOT 1
- maven distro of slack-api-client imports okhttp v4.9.3. Should be v4.12.0. HOT 2
- How to un-register/re-register a message listener HOT 4
- Slack couldn't verify messages with *(bold) w/ Spring Boot HOT 1
- Message sent after file upload comes earlier than the file appears in the channel HOT 4
- ResponseMetadata missing in AdminInviteRequestsResponse HOT 2
- FileUploadV2 is breaking two useful features available in pervious version HOT 9
- entity.message is missing in Audit Logs API response HOT 1
- Slack API that allows me to call to install an app on a specific channel and remove an app on a specific channel HOT 7
- How do I respond to the url_verification event? HOT 2
- bolt-servlet implementation with dropwizard giving AppConfig ClassNotFound issue HOT 4
- Events Lag Issue HOT 4
- ImageElement.setImageBytes(Integer) HOT 2
- Can we use "Bot is typing..." feature via APIs? HOT 1
- SVG support for image block HOT 3
- Certain team ids getting 401 HTTP response from event subscription URL while others work HOT 2
- Slack files have inconsistent privacy when calling upload APIs on different platforms HOT 5
- Rich Text Block Mismatch in Java Class and Json Version HOT 2
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 java-slack-sdk.