NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page [resolved] Reversing url_encode type effect in perl?

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 05-05-2007, 09:27 AM THREAD STARTER               #1 (permalink)
NamePros Regular
 
beaver6813's Avatar
Join Date: May 2005
Location: England
Posts: 392
beaver6813 is a jewel in the roughbeaver6813 is a jewel in the roughbeaver6813 is a jewel in the rough
 




Reversing url_encode type effect in perl?


Hey,

There is an upload script i'm using, it locks the files and only chmods them to 600, making them virtually impossible to access in php, i've managed to deconstruct how it works but to get perl to chmod the file i need to know the file name... but it only has it in url encoded form:
????: NamePros.com http://www.namepros.com/programming/324453-resolved-reversing-url_encode-type-effect-perl.html

Code:
$tmp_filename =~ s/([^a-zA-Z0-9_\-.])/uc sprintf("%%%02x",ord($1))/eg;
Anyone know how to reverse this so i can have the url in plain form in perl?

Resolved. Some guy over at devshed gave the code to reverse :-) For future reference the opposite would be:

Code:
$tmp_filename =~ s{%([a-fA-F0-9][a-fA-F0-9])}{pack("C", hex($1))}eg;
beaver6813 is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 01:52 PM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger