Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

Anchor tag on Fitnesse page to download file.

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have a local file path which i can access via FIXTURE. this is a dynamic file path but the file exists. Now i need to display the file as HYPERLINK on fitnesse page but it is unable to download.

public String printOutputXml() throws ParseException, FileNotFoundException, IOException {
String submissionFileName = baseTestLoader.getReportMetaData().get("submissionFileName");
//String submissionFileName = "auth.012.001.02.549300ZK53CNGEEI6A29.:COB_DATE.0001";
List<String> dates = baseTestLoader.getWorkDatesList(this.startDate, this.endDate);
StringBuilder builder = new StringBuilder();
logger.info("Dates Report Ran"+dates.toString());
for(String cobdate: dates) {
cobdate = cobdate.replace("-", "");
submissionFileName = submissionFileName.replace(":COB_DATE", cobdate);
//String FILE_LOCATION = "/tmp/"+submissionFileName;
String FILE_LOCATION = "C:\\Temp\\tempMMSRFiles\\temp\\"+submissionFileName;
logger.info("File Localtion : "+FILE_LOCATION);
String outputDisplay = "<a href=\""+FILE_LOCATION+"\" download>"+submissionFileName+"?</a><br>";
builder.append(outputDisplay);
}
return "<pre>"+builder.toString()+"</pre>";
}


I have used <pre> bcz other wise the anchor tag was printed as text. right now it is showing as Anchor tag but nothing is happening and no download is enabled. can someone please help
 
What a show! What atmosphere! What fun! What a tiny ad!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic