Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums

Go Back   Code Forums > Application and Web Development > PHP

Reply
 
LinkBack Thread Tools Display Modes
Old 08-11-2003, 03:41 PM   #1 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
When Uploading an image .. Can you rename with a space?

is it possible to upload a file and name it with a space?
PHP Code:
<?
$name
="Oh No";

copy($file$path "/" $name ".jpg");
?>
it does not like this . the upload gets named ".jpg"
__________________
Mike
sde is offline   Reply With Quote
Old 08-11-2003, 08:04 PM   #2 (permalink)
EscapeCharacter
GNU/Punk
 
EscapeCharacter's Avatar
 
Join Date: Jul 2002
Location: stuffs
Posts: 66
EscapeCharacter is on a distinguished road
Send a message via AIM to EscapeCharacter
you could convert the space to "\ " (slash space). that usually fixes problems with spaces
__________________
cd /usr/ports/misc/life && make install
EscapeCharacter is offline   Reply With Quote
Old 08-11-2003, 08:13 PM   #3 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
i ended up usually replacing " " with "_" .. i'll try that later, .. thanks =)
__________________
Mike
sde is offline   Reply With Quote
Old 08-11-2003, 08:18 PM   #4 (permalink)
npa
Code Monkey
 
Join Date: Jul 2003
Location: canada
Posts: 82
npa is on a distinguished road
or put talking marks around it

Code:
$name = "\"hello world\"";
__________________
direct entry file specification.
npa is offline   Reply With Quote
Old 08-11-2003, 09:02 PM   #5 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
i tried it with quotes, single quotes, and back ticks and it just names the file with the quotes.
__________________
Mike
sde is offline   Reply With Quote
Old 08-11-2003, 09:07 PM   #6 (permalink)
npa
Code Monkey
 
Join Date: Jul 2003
Location: canada
Posts: 82
npa is on a distinguished road
try it again including the path in the variable:
Code:
$name = "hello world.jpg";
$path = "/root/";
$real = "\"" . $path . $name . "\""
__________________
direct entry file specification.
npa is offline   Reply With Quote
Old 08-11-2003, 10:02 PM   #7 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
=/ .. same results as earlier. i was using the full path, but i did it over again to check for sure.
__________________
Mike
sde is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Small modification needed on image flipping JavaScript Epsilon HTML, XML, Javascript, AJAX 0 08-31-2004 06:06 PM
Finding the size of an image? Epsilon PHP 2 06-22-2003 03:23 PM
I am a newb, how do you set multiple parts of an image as a link? I sniper baby HTML, XML, Javascript, AJAX 5 02-10-2003 07:40 PM
Stable Graphical FTP Client, HTML editor, & Image Manipulation for RedHat 7.3? Admin Linux / BSD / OS X 2 08-30-2002 05:55 PM


All times are GMT -8. The time now is 10:24 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8 ©2007, Crawlability, Inc.





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting