This week's book giveaway is in the Beginning Java forum.
We're giving away four copies of Get Programming with Java (MEAP only) and have Peggy Fisher on-line!
See this thread for details.
Win a copy of Get Programming with Java (MEAP only) this week in the Beginning Java forum!
  • 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
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Problem with recognizing file type  RSS feed

 
Ranch Hand
Posts: 833
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am using Tomcat with 64 bit and it runs all the classes fine. I am compiling them to 32 bit on another computer as my dedicated online server is 32 bit and tomcat is connected with apache through mod_jk connector.

This code is working fine on offline computer but when am uploading my class to online dedicated server it prints "Only zip file is accepted".
I checked and printed the file type in 3 different browsers and browser showing correct file type i.e. application/zip

Is there any problem with apache or tomcat or anything else?

Here is my code:



Thanks in anticipation
 
Sheriff
Posts: 21558
100
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Farakh khan wrote:


Leave that out. f14 is a File object and will never be equal to any String.


That if statement will always be executed. You're saying that if the file type is not application/zip or not application/x-zip-compressed the block should be exected. Since these two Strings are different, the file type will always be different from one of the two; if it's application/zip then it's not application/x-zip-compressed and vice versa. Change the || into &&, and the block will be executed if the file type is neither of the two Strings - exactly what you want.
 
A berm makes a great wind break. And Iwe all like to break wind once in a while. Like this tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!