When members upload a picture to their profiles if the extension is .jpg, or .png everything is fine; however, if the extension is all uppercase .JPG or .PNG, the photo still uploads but doesn’t display.

What could be causing this? I’ve pasted some code below but I’m not sure if it’s the exact place where the problem is accruing. Let me know if you need to see anything else. The site uses html, php, xml, and js.


php code for page where members upload photos:

if($inpAction == "Upload") {
		//prepare destination path
		$ImagesDirectory = Footprint::FilePath("_MEDIA/photos/");
		$FileInfo = pathinfo(Footprint::$Request->File("file")->FileName);
		$FileName = "img_". rand() .".". ($FileInfo["extension"] == "" ? "jpg" : $FileInfo["extension"]);
		$FullSavePath = $ImagesDirectory . $FileName;
		chmod($ImagesDirectory, 0755);
		//save file
		//create new listing photo
		Footprint::$DB->SQLCommand = Footprint::$SQL->GetCommand("create-new-photo", Footprint::FilePath("account/profile.sql.xml"));
		Footprint::$DB->SQLKey("%fk_user_id%", Footprint::$Request->Session("user_id"));
		Footprint::$DB->SQLKey("%label%", ($inpLabel == "" ? "N/A" : $inpLabel));
		Footprint::$DB->SQLKey("%filename%", $FileName);

html code where members upload photos:

<fieldset data-label="photo_container">
  <form action="" method="post" name="form" id="form" enctype="multipart/form-data" data-label="photo_upload_form">
    <table border="0" cellpadding="3" cellspacing="0" class="form">
        <td class="field_label"><img src="../_MEDIA/icon-required.gif" alt="Required Field" width="15" height="15" align="absmiddle" /> Label:</td>
        <td class="field"><input type="text" value="" maxlength="255" size="25" name="label" data-field="label"/></td>
        <td valign="top" class="field_label"><img src="../_MEDIA/icon-required.gif" alt="Required Field" width="15" height="15" align="absmiddle" /> Photo:</td>
        <td class="field"><input type="file" name="file" data-field="file"/><br />
<span style="color:#666; font-size:12px;">Photos can be .jpg or .png <br />
(file title should have no-spaces and be all lowercase letters)</span></td>
        <td class="label">&#160;</td>
        <td class="field"><input type="submit" value="Upload" name="action" data-field="button_upload"/></td>
    <hr />
  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="results">
    <tr class="header">
    <tr data-label="blank_results_row">
      <form action="" method="post" name="form" id="form">
        <td><a target="_blank" data-label="photo_link"><img border="0" data-label="photo_path" alt="photo_path" /></a></td>
        <td data-label="label">label</td>
        <td class="wrap_text max_width"><input data-field="button_photo_delete" type="submit" value="Delete Photo" name="action"/>
          <input data-field="account_photo_id" type="hidden" value="" name="account_photo_id"/>
    <tr data-label="no_results_row">
      <td colspan="7"><h3>No photos found.</h3></td>
  <!--xslt-include href="../../_GLOBAL/paging-table.html"-->

If you are running on Linux, it doesn't treat upper and lower case as the same thing. Either your upload routine has to force everything to lower case (or upper if you prefer) or the display routine has to look for both variations. I didn't go through your code but that is the most likely reason.

what crishea said
assume all servers servers are case sensitive,
windows servers arent, but with good fortune you'll never have to work on a windows server,
caveBob say ugg apache linux good, ugg windows bad

have your file upload script force all filenames to the form your server understands
line 6 in the op above something like

$FullSavePath = $ImagesDirectory.strtolower($FileName);