How to save an image-file on server through Java applet?

与世无争的帅哥 提交于 2019-12-06 14:05:26

问题


I have a paint application that runs as a Java applet. I need to save the contents of the canvas on server machine in any image-format typically PNG. Please help!


回答1:


You might be interested by the code I wrote for Processing, which is basically Java code. Re: save to web --- image export. Earlier in the thread I explain some precautions to be taken with such application (to avoid flooding a server from a malicious user) and I give the corresponding PHP code.




回答2:


You need to do two things:

  1. Generate an PNG image file in your applet - Writing/Saving an Image
  2. Post the image file to some server-side CGI/servlet which will store the image - How do I upload a file to my servlet or JSP?

What are you running on the server? PHP? Rails? JSP? .NET?



来源:https://stackoverflow.com/questions/400422/how-to-save-an-image-file-on-server-through-java-applet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!