• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Looking for a PHP that allows users to upload to a directory

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.
oh you've got to love regexes like this: $filename =~ s/^.*[\/\\]([^\/\\]+)$/$1/;
and hash references are fun, too: $$exts{$ext}

🙂
 
Originally posted by: Tyler
oh you've got to love regexes like this: $filename =~ s/^.*[\/\\]([^\/\\]+)$/$1/;
and hash references are fun, too: $$exts{$ext}

🙂

Can't you use #'s or commas instead of /'s, and not have to escape the /'s?

$filename =~ s/^.*[\/\\]([^\/\\]+)$/$1/;
$filename =~ s,^.*[/\\]([^/\\]+)$,$1,;
 
Originally posted by: BingBongWongFooey
Originally posted by: Tyler
oh you've got to love regexes like this: $filename =~ s/^.*[\/\\]([^\/\\]+)$/$1/;
and hash references are fun, too: $$exts{$ext}

🙂

Can't you use #'s or commas instead of /'s, and not have to escape the /'s?

$filename =~ s/^.*[\/\\]([^\/\\]+)$/$1/;
$filename =~ s,^.*[/\\]([^/\\]+)$,$1,;

I could, but I dont. No particular reason, I'm just accustomed to doing it that way.
 
Originally posted by: Tyler
Originally posted by: BingBongWongFooey
Originally posted by: Tyler
oh you've got to love regexes like this: $filename =~ s/^.*[\/\\]([^\/\\]+)$/$1/;
and hash references are fun, too: $$exts{$ext}

🙂

Can't you use #'s or commas instead of /'s, and not have to escape the /'s?

$filename =~ s/^.*[\/\\]([^\/\\]+)$/$1/;
$filename =~ s,^.*[/\\]([^/\\]+)$,$1,;

I could, but I dont. No particular reason, I'm just accustomed to doing it that way.

Ah, it was actually a question of literally whether you could 😛 (I knew that from sed but wasn't sure if perl used it too).
 
write something custom 🙂

or better yet come up with something cool like storing data in a database

i've got code that allows you to store anything (within the limits of HTTP) into a mysql BLOB field. kinda cool storing binaries in a db if you ask me 🙂 not really good for a large-scale project, but nifty for only a few users. i have it if you're interested, pm me
 
Back
Top