Read and access data and write file in directory

Skip to first unread message


Dec 29, 2010, 2:29:01 AM12/29/10
to Google Web Toolkit
I need to read a file and access it and write i.e i need to read a
dicom file and get dicom data. due to i am new to GWT i don't know how
to do. send me a sample code if you have. I used fileupload widget but
its show only the file name with fakepath(c:/fakepath/filename).

Jim Douglas

Dec 29, 2010, 3:30:22 AM12/29/10
to Google Web Toolkit
First, you cannot directly write a client-side file in JavaScript.
The primary design goal of the HTML file input widget is for the user
to select a file, which is then uploaded to a servlet for processing
on the server. For a high level overview of the process, search this
forum for fileupload, for example:

Second, the c:\fakepath\ thing is a security feature, originally
implemented in Opera and IE8, but now an official W3C standard. You
can read the background here:

You might also want to review the File API, which allows for client-
side reading (not writing) of files selected by the user in a
fileupload widget.

If your ultimate goal is to deliver a file to the client, you'll need
to get there in a roundabout way, by making the file available for the
user to download:
Reply all
Reply to author
0 new messages