这里:
// Add ZIP entry to output stream. out.putNextEntry(new ZipEntry(filename));
您正在使用整个路径为该文件创建条目。如果仅使用名称(不带路径),则将具有所需的内容:
// Add ZIP entry to output stream. File file = new File(filename); //"Users/you/image.jpg"out.putNextEntry(new ZipEntry(file.getName())); //"image.jpg"



