My query has two parts:
1. Can I pass an audio file from one jsp to another using form submit.
2. If yes, then how do I write this file to another file in the next jsp page.

I was going through the AudioInputstream class but couldnt make much head-through.

Any help will be much appreciated.

Cheers,
Moonis

>Can I pass an audio file from one jsp to another using form submit.
>If yes, then how do I write this file to another file in the next jsp page.

JSP - Java Server Pages are servlets and they are compiled and executed (managed) by the web container (application server). A servlet is a server-side java program that runs in response to an HTTP request. The role of a servlet is to accept requests from the client, invoke the appropriate application logic to fullfill the request, and returns the results to the client.

So, I don't think you need to copy a file. If you want to play this audio file at client; use object or embed html tags.

Ok. let's put it this way. Suppose i have main.jsp where I select a file. (input type=file) and submit this form to process.jsp. I want to know, how to retrieve the file on process.jsp. Will request. getParameter work here?

To upload a file, html form tag must be look like this.

<form action="upload.jsp"
  method="post" enctype="multipart/form-data">
  Select a file: 
  <input type="file" name="first" />
  <br />
  <input type="submit" name="button" value="upload" />
</form>

http://commons.apache.org/fileupload/

SUMMARY:The Commons FileUpload package makes it easy to add robust, high-performance, file upload capability to your servlets and web applications.

Thanks. This is exactly what i want.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.