|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
image uploading problem in Java
Hi,
I have an image uploading problem. The entire code is working in my local system. But when i upload the code, it is not working from the Linux server. The code I have given is RenderedImage image = null; InputStream is = new BufferedInputStream(new FileInputStream(f)); image = ImageIO.read(is); OutputStream out1 = new BufferedOutputStream(new FileOutputStream(file)); ImageIO.write(image,"png",file); Should I give any permission to upload the image file? Can anybody please respond as soon as possible. Thanking You |
|
#2
|
||||
|
||||
|
Linux is much pickier than Windows when it comes to permissions.
Make sure the folder you are uploading to has the proper write permissions. A common solution is to change ownership on the folder to the same user that the server runs as. Alternatively, you could give write permissions to "other"; this could be considered a security flaw. |
|
#3
|
||||
|
||||
|
I've had a similar problem. I work locally under Windows, the server my web app is on, is a Linux server. Whenever I upload .class files, I must not forget to change the permissions of these .class files. I always have to add the execute-permission for the user, group and other.
So, take a look at the rwx or read-write-execute permissions of your .class files. Without the x for execute, the .class file might give you problems. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > Java Development > image uploading problem in Java |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|