cancel
Showing results for 
Search instead for 
Did you mean: 

Display the content of Uploaded file

Former Member
0 Kudos

Hai,

Is it possible to display the content of the uploaded file in a Text Area?

Please guide me...

- Krish

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

technically yes, It depends based on the content.

Regards

Ayyapparaj

Former Member
0 Kudos

Thanks a lot...

If it is a .txt or .doc file how should i proceed?

Krish

Edited by: Krish Krish on Nov 20, 2008 1:37 PM

Former Member
0 Kudos

Hi,

Following code will help you to do this


  IWDResource resource = wdContext.currentContextElement().getUpload(); // your existing handle to the upload resource type
	  try {
		InputStream stream = resource.read(true);
		byte b[]= new byte[1000];
		stream.read(b);
		String str = new String(b);
		wdContext.currentContextElement().setTest(str);
	} catch (IOException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}

Regards

Ayyapparaj

Answers (1)

Answers (1)

yogesh_galphade
Contributor
0 Kudos

Hi

You can use IFrame to show the data ; that can be pdf file