php - "No Such File or Directory" Though the File is There? -
i getting error message:
warning: move_uploaded_file(uploads/1f77f7e78f36847859c0604e9645f112.jpg): failed open stream: no such file or directory in c:\xampp\htdocs\ubergallery\multiple_image_upload\upload.php on line 17 warning: move_uploaded_file(): unable move 'c:\xampp\tmp\phpe035.tmp' 'uploads/1f77f7e78f36847859c0604e9645f112.jpg' in c:\xampp\htdocs\ubergallery\multiple_image_upload\upload.php on line 17 1).please seek again!.
"upload.php" included within "multiupload.php" , looking include "multiupload.php" within "index.php" located here:
ubergallery/resources/themes/uber-blue/index.php
the other 2 files located here:
ubergallery/multiple_image_upload/multiupload.php ubergallery/multiple_image_upload/upload.php
this upload.php:
<?php if (isset($_post['submit'])) { $j = 0; //variable indexing uploaded image $target_path = "uploads/"; //declaring path uploaded images ($i = 0; $i < count($_files['file']['name']); $i++) {//loop individual element array $validextensions = array("jpeg", "jpg", "png"); //extensions allowed $ext = explode('.', basename($_files['file']['name'][$i]));//explode file name dot(.) $file_extension = end($ext); //store extensions in variable $target_path = $target_path . md5(uniqid()) . "." . $ext[count($ext) - 1];//set target path new name of image $j = $j + 1;//increment number of uploaded images according files in array if (($_files["file"]["size"][$i] < 100000) //approx. 100kb files can uploaded. && in_array($file_extension, $validextensions)) { if (move_uploaded_file($_files['file']['tmp_name'][$i], $target_path)) {//if file moved uploads folder echo $j. ').<span id="noerror">image uploaded successfully!.</span><br/><br/>'; } else {//if file not moved. echo $j. ').<span id="error">please seek again!.</span><br/><br/>'; } } else {//if file size , file type incorrect. echo $j. ').<span id="error">***invalid file size or type***</span><br/><br/>'; } } } ?>
and index.php:
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>qinter</title> <link rel="shortcut icon" href="<?php echo themepath; ?>/images/favicon.png" /> <link rel="stylesheet" type="text/css" href="<?php echo themepath; ?>/rebase-min.css" /> <link rel="stylesheet" type="text/css" href="<?php echo themepath; ?>/style.css" /> <?php echo $gallery->getcolorboxstyles(5); ?> <script type="text/javascript" src="//code.jquery.com/jquery-2.1.0.min.js"></script> <?php echo $gallery->getcolorboxscripts(); ?> <?php file_exists('googleanalytics.inc') ? include('googleanalytics.inc') : false; ?> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="http://localhost/ubergallery/multiple_image_upload/script.js"></script> <!-------including css file------> <link rel="stylesheet" type="text/css" href="http://localhost/ubergallery/multiple_image_upload/style.css"> </head> <body> <div class="imageupload clearfix"> <?php include($_server['document_root']. '/ubergallery/multiple_image_upload/multiupload.php'); ?> </div> <!-- start ubergallery v<?php echo ubergallery::version; ?> - copyright (c) <?php echo date('y'); ?> chris kankiewicz (http://www.chriskankiewicz.com) --> <div id="gallerywrapper"> <div class="line"></div> <?php if($gallery->getsystemmessages()): ?> <ul id="systemmessages"> <?php foreach($gallery->getsystemmessages() $message): ?> <li class="<?php echo $message['type']; ?>"> <?php echo $message['text']; ?> </li> <?php endforeach; ?> </ul> <?php endif; ?> <div id="gallerylistwrapper"> <?php if (!empty($galleryarray) && $galleryarray['stats']['total_images'] > 0): ?> <ul id="gallerylist" class="clearfix"> <?php foreach ($galleryarray['images'] $image): ?> <li><a href="<?php echo html_entity_decode($image['file_path']); ?>" title="<?php echo $image['file_title']; ?>" rel="colorbox"><img src="<?php echo $image['thumb_path']; ?>" alt="<?php echo $image['file_title']; ?>"/></a></li> <?php endforeach; ?> </ul> <?php endif; ?> </div> <div class="line"></div> <div id="galleryfooter" class="clearfix"> <?php if ($galleryarray['stats']['total_pages'] > 1): ?> <ul id="gallerypagination"> <?php foreach ($galleryarray['paginator'] $item): ?> <li class="<?php echo $item['class']; ?>"> <?php if (!empty($item['href'])): ?> <a href="<?php echo $item['href']; ?>"><?php echo $item['text']; ?></a> <?php else: ?><?php echo $item['text']; ?><?php endif; ?> </li> <?php endforeach; ?> </ul> <?php endif; ?> </div> </div> <!-- end ubergallery - distributed under mit license: http://www.opensource.org/licenses/mit-license.php --> </body> </html>
i hope can help error message.
no such file or directory in c:\xampp\htdocs\ubergallery\multiple_image_upload\upload.php on line 17
the file there.
make sure appropriate permissions assigned script , there folder in same location script titled uploads
. chmod looking (try avoid 777, that's lazy)
also, windows host? though doesn't matter seek this:
$target_path = "uploads" . directory_separator; //declaring path uploaded images
php apache
No comments:
Post a Comment