Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Uploading file not in right format

Posted on 2006-11-13
6
Medium Priority
?
174 Views
Last Modified: 2010-03-04
Hi, i'm using an apache web-based application to upload certain files. Anyway, the files must be in a certain format. The format should be <server>-<version#>.zip.

Let's say the service name is service. In the past I was able to put something like server.3.5.6.zip and it would work. (Or server.3_5_6.zip).

Well, we migrated to another physical linux server, same specs (Red Hat ES 3.0). Copied all the same files over. Now when i try an upload a file, it won't take any files with "dots" in them, I get a format error. For example server.3.5.6.zip will not work but server.3_5_6.zip.

I went to the location of the page and it calls a file called deployment.php and in there it says:
$regex_match       = "$service-[0-9a-zA-Z_-]+\.zip" ;
$format_msg        = "ERROR - File must be in the format:  $service-version#.zip!" ;

I'm getting the format error. Now in the regex_match variable it doesn't say anything about a "." character. My question is, why was it working before? And how would I get it to accept "." in the version name?

The only difference between the old configuration and new one is that hte old was a virtual host while the new is the main (only) host.
0
Comment
Question by:pieman8080
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 6

Expert Comment

by:bimal_linux
ID: 17937021
what is the magic_quotes_gpc status in your php.ini?

Bimal
0
 

Author Comment

by:pieman8080
ID: 17942330
magic_quotes_gpc = On
0
 
LVL 16

Expert Comment

by:HackneyCab
ID: 17942627
I'm not sure I understand your question. But the regex you demonstrate looks wrong. The $ symbol means "end of pattern", not "start of pattern". Does this do what you are aiming for:

$regex_match = "^service-[0-9a-zA-Z_-]+\.zip$";

or am I misunderstanding your question?
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
LVL 16

Accepted Solution

by:
HackneyCab earned 2000 total points
ID: 17942655
Ah, sorry, you're trying to use $service as a variable. Also, I note that your pattern does not permit periods in the text before the file extension. Try this instead of my above suggestion:

$regex_match = $service.'-[0-9a-zA-Z_.-]+\.zip";

That will convert $service to a string (outside of the quotes, to be safe) and it allows periods in the pattern defined by the character class.
0
 

Author Comment

by:pieman8080
ID: 17942788
It worked, thank you! Note i didn't use the ' character. I tried putting the "." in the string but after the _- and it didn't work. When I put it in the middle as you suggested it worked.
0
 
LVL 16

Expert Comment

by:HackneyCab
ID: 17947142
Sorry, I was using the single-quote ' symbol to start the pattern string, but I've foolishly ended the pattern string with a double-quote " symbol. My bad.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question