Hello,
I thought the name for the file part should be match with the name of file
input type in the HTML form. However, I did change the code as your
suggestion, it didn't work.
FilePart lFilePart = new FilePart("photofile.jpg", lFile)
Thanks,
Marshall
On 12/13/06, Roland Weber <[EMAIL PROTECTED]> wrote:
Hello,
"Zhenyu Wang" <[EMAIL PROTECTED]> wrote on 13.12.2006 08:30:00:
> - "Files not uploaded. We only accept .jpg, or gif". Strangely, the
same
> code has been used to upload the images to other external sites
> sucessfully. Any suggestion why is this happening? Thanks.
I guess other external sites don't check the file type, or don't
check it in the same way as this site.
> File lImageFile = new File("C:\\heart.jpg");
> FilePart lFilePart = new FilePart("photofile", lFile);
> lFilePart.setContentType("image/jpeg");
Have you tried "photofile.jpg" as the file part name?
hope that helps,
Roland