How to download multiple files as zip in vb.net. Lost my extension while downloading in firefox -
i downloading multiple files zip file in vb.net. of browsers doesn't add zip file.
my code is:
if not ispostback if not session("x") = nothing dim x string = session("x").tostring dim path() string path = x.split("|"c) using zip new zipfile() zip.alternateencoding = encoding.utf8 zip.alternateencodingusage = zipoption.asnecessary = 0 ubound(path) if len(path(i)) > 0 dim filepath string = trim(path(i)) zip.addfile(filepath) end if next response.clear() response.bufferoutput = false dim zipname string = [string].format _ ("datas_{0}.zip", datetime.now.tostring("dd-mmm-yyyy")) response.contenttype = "application /zip" response.addheader("content-disposition", "attachment;filename=" + zipname + "") zip.save(response.outputstream) httpcontext.current.applicationinstance.completerequest() response.flush() session.removeall() session.clear() session.abandon() end using else response.redirect("frmuser.aspx") end if end if
my files downloading zip file in chrome , ie in firefox downloading xml files , downloading without extension. dono whats actual problem is?
Comments
Post a Comment