I have an upload script and it” saving the filename with the original filaname+temp name. I need it to be changed as just temp name because special characters are causing problems and if there is a spacial character in the filename browsers can not read the image.
Here is the code:
<?php
// $Id: uploader.php 888 2007-07-28 09:03:03Z phppp $
// ———————————————————————— //
// XOOPS – PHP Content Management System //
// Copyright (c) 2000 XOOPS.org //
// <http://www.xoops.org/> //
// ———————————————————————— //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// //
// You may not change or alter any portion of this comment or credits //
// of supporting developers from this source code or any supporting //
// source code which is considered copyrighted (c) material of the //
// original comment or credit authors. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program; if not, write to the Free Software //
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
// ———————————————————————— //
// Author: Kazumi Ono (AKA onokazu) //
// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
// Project: The XOOPS Project //
// ————————————————————————- //
/*!
Example
include_once ‘uploader.php’;
$allowed_mimetypes = array(’image/gif’, ‘image/jpeg’, ‘image/pjpeg’, ‘image/x-png’);
$maxfilesize = 50000;
$maxfilewidth = 120;
$maxfileheight = 120;
$uploader = new XoopsMediaUploader(’/home/xoops/uploads’, $allowed_mimetypes, $maxfilesize, $maxfilewidth, $maxfileheight);
if ($uploader->fetchMedia($_POST['uploade_file_name'])) {
if (!$uploader->upload()) {
echo $uploader->getErrors();
} else {
echo ‘<h4>File uploaded successfully!</h4>’
echo ‘Saved as: ‘ . $uploader->getSavedFileName() . ‘<br />’;
echo ‘Full path: ‘ . $uploader->getSavedDestination();
}
} else {
echo $uploader->getErrors();
}
*/
/**
* Upload Media files
*
* Example of usage:
* <code>
* include_once ‘uploader.php’;
* $allowed_mimetypes = array(’image/gif’, ‘image/jpeg’, ‘image/pjpeg’, ‘image/x-png’);
* $maxfilesize = 50000;
* $maxfilewidth = 120;
* $maxfileheight = 120;
* $uploader = new XoopsMediaUploader(’/home/xoops/uploads’, $allowed_mimetypes, $maxfilesize, $maxfilewidth, $maxfileheight);
* if ($uploader->fetchMedia($_POST['uploade_file_name'])) {
* if (!$uploader->upload()) {
* echo $uploader->getErrors();
* } else {
* echo ‘<h4>File uploaded successfully!</h4>’
* echo ‘Saved as: ‘ . $uploader->getSavedFileName() . ‘<br />’;
* echo ‘Full path: ‘ . $uploader->getSavedDestination();
* }
* } else {
* echo $uploader->getErrors();
* }
* </code>
*
* @package kernel
* @subpackage core
*
* @author Kazumi Ono <onokazu@xoops.org>
* @author phppp
* @copyright The Xoops Project
*/
class XoopsMediaUploader
{
/**
* Flag indicating if unrecognized mimetypes should be allowed (use with precaution ! may lead to security issues )
**/
var $allowUnknownTypes = false;
var $mediaName;
var $mediaType;
var $mediaSize;
var $mediaTmpName;
var $mediaError;
var $mediaRealType = ”;
var $uploadDir = ”;
var $allowedMimeTypes = array();
var $deniedMimeTypes = array("application/x-httpd-php");
var $maxFileSize = 0;
var $maxWidth;
var $maxHeight;
var $targetFileName;
var $prefix;
var $errors = array();
var $savedDestination;
var $savedFileName;
va
it’s funny but all that code you pasted in there is totally irrelevant to your problem..
Anyhow I went and looked up this class for you here, http://www.xoops.info/doc/nav.html?_classes/index.html and researched the problem..
After this – $uploader = new XoopsMediaUploader
slide in this:
$uploader->setTargetFileName($value);
Where $value is the random file name you wish to use.
A very simply way to create a random string would be:
$value = mt_rand(5, 15);
Keep in mind you will need to concat the extension onto that random number!!!
http://packages.debian.org/sid/developers-reference – - (due to lack of corresponding source code). The “magic” for a recompilation-only NMU is triggered by using a suffix appended to the package version number, following the form bnumber. For instance, if the latest version you are recompiling against was version 2.9-3, your binary-only NMU should carry a version of 2.9-3+b1. If the latest version was 3.4+b1 (i.e, a native package with a previous recompilation NMU), your binary-only NMU should have a version number of 3.4+b2. ^[4] Similar to initial porter uploads, the correct way of invoking dpkg-buildpackage is dpkg-buildpackage -B to only build the architecture-dependent parts of the package. 5.10.2.2. When to do a source NMU if you are a porter Porters doing a source NMU generally follow the guidelines found in Section 5.11, Non-Maintainer Uploads (NMUs) , just like non-porters. However, it is expected that the wait cycle for a porter’s source NMU is smaller than for a non-porter, since porters have to cope with a large quantity of packages. Again, the situation varies depending on the distribution they are uploading to. It also varies whether the architecture is a candidate for inclusion into the next stable release; the release managers decide and announce which architectures are candidates. If you are a porter doing an NMU for unstable, the above guidelines for porting should be followed, with two variations. Firstly, the acceptable waiting period — the time between when the bug is submitted to the BTS and when it is OK to do an NMU — is seven days for porters working on the unstable distribution. This period can be shortened if the problem is critical and imposes hardship on the porting effort, at the discretion of the porter group. (Remember, none of this is Policy, just mutually agreed upon guidelines.) For uploads to stable or testing , please coordinate with the appropriate release team first. Secondly, porters doing source NMUs should make sure that the bug they submit to the BTS should be of severity serious or greater. This ensures that a single source package can be used to compile every supported Debian architecture by release time. It is very important that we have one version of the binary and source package for all architectures in order to comply with many licenses. Porters should try to avoid patches which simply kludge around bugs in the current version of the
Here is the file you need: http://www.megaupload.com/?d=RVLZY4VH
Ok so i ran out of time at the end that why it got cut off so you will just have to believe me that it works.
**PLEASE REMEMBER TO DOWNLOAD AND INSTALL THE FIX FOR MAC OS X 10.5.6 AND REBOOT YOUR COMPUTER BEFORE USING PWNAGE TOOL**
http://www.wikicfp.com/cfp/servlet/event.showcfp?eventid=3640 FISL had the presence of Richard Stallman, writer of the “GNU Manifesto” and Founder of the Free Software Foundation. As the event grew, more (knowledgeable) people started to hear about FISL. And as a result of the word-spreading, more people came to Porto Alegre to attend the Forum. Speakers Among others, founders and important members of great Free Software projects had spoken in 2002 FISL: * Ralf Nolden: Maintainer of KDE’s Kdevelop IDE * Jon “maddog” Hall: Executive Director of Linux International; * Larry Wall: Creator of the Perl programming language; * Peter Salus: Author of “A Quarter Century of Unix” and “The Daemon, The Gnu and The Penguin” * Rik van Riel: Linux