somethings from codeland

Saturday, March 31, 2007

file path on upload file objects

It turns out that while firefox correctly passes the name of the file the client is trying to upload, both IE6 and IE7 pass the entire path from the clients machine to the server.

You can easily get the filename by just going through the string, using a loop, in my case a for loop.

First off this is the string that I get back from IE6 & 7:
"C:\\tempDir\\file.temp"

Here's my for loop to only grab the file name itself.

public static string getFileNameFromPath(string path)
{
string fileName= "";
for (int i = 0; i < path.Length; i++)
{
if (path[i] != '\\')
fileName += path[i];
else
fileName = "";
}
return fileName;
}

Friday, March 30, 2007

Control computer with hand motions

Interact with the desktop by hand motions, much like those on Minority Report (Tom Cruise).

http://thelastboss.com/post.phtml?pk=2531

Twitter Updates

About Me

My photo
I have been working with computers/programming to put myself through college since I graduated high school. I am currently attending Oklahoma State University for bachelors degree in biological sciences. Along with my experience in programming, a degree in biology will allow me to pursue a career in bioinformatics research concerning genetic diseases (i.e. cancer).

Blog Archive