Jump to content

problem with image uploading using PHP


tinnumaverick

Recommended Posts

This is my PHP code which uploads the image from a html form.

 

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<title>Upload a Photograph</title>

 

<link rel="stylesheet" href="uploadify.css" type="text/css" />

 

<script language="JavaScript" type="text/javascript">

<!--

function breakout_of_frame()

{

  // see http://www.thesitewizard.com/archive/framebreak.shtml

  // for an explanation of this script and how to use it on your

  // own website

  if (top.location != location) {

    top.location.href = "http:/noltest.lib.siu.edu/drupal/blincore?file='"+fileObj.name+"'" ;

  }

}

-->

</script>

 

<script type="text/javascript" src="jquery-1.3.2.min.js"></script>

<script type="text/javascript" src="jquery.uploadify.js"></script>

<script type="text/javascript">

 

$(document).ready(function() {

        $("#fileUpload").fileUpload({

                'uploader': 'uploader.swf',

                'cancelImg': 'cancel.png',

                'script': 'upload.php',

                'folder': 'downloads',

                'fileDesc': 'Image Files',

                'fileExt': '*.jpeg,*.jpg,*.tif,*.tiff,*.gif,*.png',

                'checkScript': 'check.php',

                'multi': false,

                'displayData': 'speed',

                'onComplete': function(event, queueID, fileObj, response, data) {

                                $('#filesUploaded').append

                                        ('One Image Uploaded successfully (<a href='+fileObj.filePath+'>'+fileObj.name+'</a>)</br></br> <FORM METHOD=POST ACTION="http://nol.lib.siu.edu/drupal/dublincore"> <INPUT NAME=filename value="'+fileObj.name+'">  <INPUT TYPE=submit VALUE="NEXT" ></FORM ><br>');}

        });

});

 

 

</script>

</head>

 

<body style="background: #f1ede0 url(http://nol.lib.siu.edu//sites/all/themes/admire_grunge/images/bg2.jpg) repeat fixed top center;">

                <h2>Single Photograph Upload</h2>

                <div id="fileUpload">Issue with your javascript</div>

                <a href="javascript:$('#fileUpload').fileUploadStart()">Start Upload</a> |  <a href="javascript:$('#fileUpload').fileUploadClearQueue()">Clear Queue</a>

        <p></p> <p><div id="filesUploaded"></div></p>

 

</body>

</html>

 

 

 

 

problem: when i try to upload image from the desktop which contains image named  (test.jpg) , this test.jpg is not shown when browsing to select the image file.

 

any advice...  :confused:

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.