• 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Uploading an image.

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I want to upload an image to the web-server automatically because I use applet to get the image from scanner. Originally I wanted to save the image to disk and call javascript from applet to set the "File" attribute and post, but the "File" is read-only and only change when user browse and choose the file. How could I upload the image automatically by post of jsp or by applet?(besides the image, I also have some other hidden parameters in jsp to post together).
Hope you could help me. Thanks.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi you have to use multipart concept for that you better to check in orielly.you should have client like this.
and multipat code is avilable for free download in orielly site
<html>
<head>
</head>
<body>
<FORM METHOD=post ACTION="SaveFile.jsp" ENCTYPE="multipart/form-data">
<INPUT TYPE=file NAME=image ACCEPT="image/gif">
<INPUT TYPE=submit VALUE="Submit">
<INPUT TYPE=reset VALUE="Reset Form">
</FORM>
</body>
</html>
++++++
removed wholesale quote -MC
[ January 22, 2002: Message edited by: Mike Curwen ]
 
Dennis Lee
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe my question was not so clear just now.
What I want is no need for user to choose file, the jsp or applet could send the image to server automatically.
The jsp you provided should let the user to choose file. That is not my need.
 
    Bookmark Topic Watch Topic
  • New Topic