Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7664875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:24:55+00:00 2026-05-31T14:24:55+00:00

I uploaded zip folder using file input,but when i check if this zip is

  • 0

I uploaded zip folder using file input,but when i check if this zip is valid or not;the result was:is not a valid pkzip file,i don’t know what is the specification for valid pkzip.
I used this code to check:

form = cgi.FieldStorage() 
file_upload = form['file[]']
if zipfile.is_zipfile(file_upload.filename):
    print "%s is a valid pkzip file" % file_upload.filename
else:
    print "%s is not a valid pkzip file" % file_upload.filename

I don’t know why?for example when i upload test.zip,the o/p will be:
test.zip is not a valid pkzip file,I need a help.Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T14:24:57+00:00Added an answer on May 31, 2026 at 2:24 pm

    zipfile.is_zipfile takes a path to a file or a file-like object. You’re passing it neither, so it fails.

    Ask it about file_upload.file instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using this upload script and it was working ok a week ago but when
I've uploaded a ZIP file containing both the XML file I'm trying to read
I want to extract the files within a ZIP file I uploaded to my
I am trying to use DotNetZip 1.9 to read an uploaded zip file in
hello I'm trying to validate an uploaded file type by finfo_file function. But when
Any ideas on why this is perfectly working in my localhost but not in
I am using shell command to zip file in ruby. Then I am uploading
For some reason when trying to upload a zip file this function always returns
I have a problem such that i have zip files uploaded from forms and
I need to scan uploaded files for viruses on a Linux server, but I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.