How to upload Image at specific place or path?
Asked Answered
J

3

0

I am trying to upload Image but I can't. When my application is in local disk i.e. d:\ then it works. But when I put my application on out office server and when I am trying to upload image then it isn't working. Before I am using following path :

final String path = "D:\\Workspace\\B2B Solution\\WebContent\\product_images\\";

now my application reside at :

\\ADMIN\keyur\Workspace\B2B Solution\WebContent\product_images

place i.e. on network. So which address I have to pass in servlet I don't know.

Any help please ?

Jumna answered 10/12, 2013 at 10:31 Comment(2)
Are you using a File object?Buckram
@KevinBowersox - no I am using PART. final Part filePart = request.getPart("product_image_upload");Nigel
M
1

Probably you need to create the path like this:

File fp = new File("\\\\ADMIN\\keyur\\Workspace\\B2B Solution\\WebContent\\product_images");

You need to escape all the slashes in the path.

Another option is to use the third party JCIFS API to create a connection through Samba to the network share; that also gives you control over which user is used to connect to the share which might be helpful.

Mayle answered 10/12, 2013 at 11:47 Comment(0)
S
0
start your path with "..\Workspace\B2B Solution\WebContent\product_images" dont use full path
Swanner answered 10/12, 2013 at 10:40 Comment(0)
F
-1

In That case you need to check your path. With correct path you will not get any problem.

Feliciafeliciano answered 10/12, 2013 at 10:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.