PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 20th, 2000, 11:16 AM
Murf Murf is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 2 Murf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Im want to be able to upload word documents and im using the script below. However its not working and the error message shown below
is displayed.

Whats wrong?

This is the HTML for the form:


<FORM ENCTYPE="multipart/form-data" ACTION="upload.php" METHOD=POST>
<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="100000">
<input type="File" name="file" size="30" maxlength="255">
<INPUT TYPE="submit" VALUE="upload">

This is the php script upload.php:


<?php

if(copy($file, "/big/dom/xsuntopuser/www/files/$file_name"))

{
print("document has been uploaded");
}
else
{
print("document not copied");
}

?>

This is the error message displayed:

Warning: Unable to create '/big/dom/xsuntopuser/www/files/Rosscv.doc': Permission denied in /big/dom/xsuntopuser/www/add_upload.php on line 31
document not copied
upload report
upload tmp file: /big/dom/tmp/phpxRP5LY
file name:
file size: 23040
file type: application/msword

Hope you can Help
Cheers
Damon

Reply With Quote
  #2  
Old June 20th, 2000, 01:03 PM
hexagonal hexagonal is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 2 hexagonal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
You may want to check the permissions on the directory you are trying to upload to. You have to have write permissions on that directory.

Reply With Quote
  #3  
Old June 20th, 2000, 04:30 PM
master ken master ken is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Location: MO, US
Posts: 119 master ken User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
Send a message via AIM to master ken Send a message via Yahoo to master ken
what is the scripting of "add_upload.php"?

Reply With Quote
  #4  
Old June 21st, 2000, 08:27 AM
Murf Murf is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 2 Murf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Cheers People

I didnt have write permissions to the required directory but ive got it sorted now and it works fine.

Thanks for your time
Damon

Reply With Quote
  #5  
Old June 21st, 2000, 09:40 AM
matchau matchau is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 6 matchau User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I copy murf's script to upload file
However it is not working

Here is the error message:

Warning: Unable to open 'php2' for reading: No such file or directory in chpdevwwwupload.php3 on line 3
document not copied

Can anyone help me.
Thanks
Matchau


Reply With Quote
  #6  
Old June 21st, 2000, 10:18 PM
Aoeex Aoeex is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 24 Aoeex User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 51 sec
Reputation Power: 0
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Warning: Unable to open 'php2' for reading: No such file or directory in chpdevwwwupload.php3 on line 3
[/quote]

You need to get rid of that in the php2 file name. It seem your on windows and i had the same problem with my scripts. I think the stripslashes() function will work for this

ex. copy(stripslashes($file),"/dir/file");

I never really tried it cuz i just turned on the magic_quotes option

Reply With Quote
  #7  
Old June 22nd, 2000, 03:51 PM
matchau matchau is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 6 matchau User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I get rid of all the stuff in the upload_tmp_dir (php.ini) and I replace by a dot .

Now it is working fine
Thanks
Matchau

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > Uploading files

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap