views:

99

answers:

1

I have a form where the user can upload a zip file, it works perfectly on my side but the client I'm making the website for is not able to upload the zip.

I check for the mime type and normally it should work for her to but the problem is that her mime type looks like this:

application/octet-stream/"

why is there a /" ? anyone experienced this problem before? as I said I don't have that problem and I checked the form and the code who process the content of the form and I didn't miss a quote or anything.

+1  A: 

That does sound pretty broken - but rather than relying on the mime type, why not just check that the zip file starts with the right magic number (ASCII "PK")? Or even better, use a zip library to check that it looks vaguely sane.

Jon Skeet
how do you mean broken? the client send me the zip file and I uploaded the zip without a problem...and how would I check for that? could I have a link to a tutorial, documentation for that? please
krike
The client browser is behaving oddly is what I mean. You would check for the upload being successful by using whatever PHP libraries exist to work with zip files and trying to open the data your user has uploaded. If it looks like a reasonable zip file, assume it's okay even though the mime type was wrong.
Jon Skeet