• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

API For File Download

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anyone tell me if there exists any api for downloading file from server??

Thanks.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have a look at the classes in the package java.net. See these examples.

What protocol are you using? HTTP, FTP or something else? For FTP, see Apache Jakarta Commons Net.
[ November 13, 2007: Message edited by: Jesper Young ]
 
Jyoti Giri
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply.
I am using HTTP protocol. Actually my file(XLS) is successfully downloaded as an attachment, i can open it,view it . I am using Commons package for parsing it, and is gives exception while parsing.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you gong to tell us what the exception is, and show the code that produces it?
 
Jyoti Giri
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually , am sorry the exception comes when i use JXL package to read the file .

The exception is :
jxl.read.biff.BiffException: Unable to recognize OLE stream

and the code that produces this exception is :

try
{
SrcDir=sRootPathUpload +File.separator +fileName;
loadFile=new File(SrcDir);
workbook = Workbook.getWorkbook(loadFile);
}
catch(Exception e)
{
bFileError=true;
WriteLog1("ERROR In Creating Workbook "+e.toString(),sUploadLog);
}
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does the file path get constructed correctly (i.e., is "loadFile.exists()" true)?

Can Excel open the file without problems?
 
Jyoti Giri
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank You For your help. My problem is solved.

Cheers!!
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What was the problem?
 
Jyoti Giri
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, after downloading the file , i was using jxl package to get(read) the cell contents, but i used table format to write it on output...so when i tried to upload it again, it was not pure xls file, hence the biff exception.

Now i am using writeble workbook to write.

Thanks for your time and help.
 
Beauty is in the eye of the tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic