Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Uploading file not in right format

Posted on 2006-11-13
6
Medium Priority
?
176 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
  • 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
Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

 
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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month5 days, 22 hours left to enroll

773 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