Git Product home page Git Product logo

Comments (5)

oppokui avatar oppokui commented on August 11, 2024

@seratch do you know anything I am missing in the .zip upload process?

from java-slack-sdk.

seratch avatar seratch commented on August 11, 2024

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:")
);

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.

oppokui avatar oppokui commented on August 11, 2024

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.

seratch avatar seratch commented on August 11, 2024

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.

oppokui avatar oppokui commented on August 11, 2024

@seratch , no problem. Happy weekend!

from java-slack-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.