Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
uploading script problem, will pay $30 if someone set it up for me.
Old 07-29-2006, 11:23 AM uploading script problem, will pay $30 if someone set it up for me.
CircleOfLinks's Avatar
Extreme Talker

Posts: 243
Name: Danny
Location: Sydney
Trades: 1
Hi, i need a script where people can upload an image to me from there comp. Max size of image to be 100k.
I recently got a script from this site but i keep getting an 'error' message. The script i got is.


HTML Code:
<form enctype="multipart/form-data" action="upload.php" method="post"> <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> Choose a file to upload: <input name="userfile" type="file" /> <input type="submit" value="Upload File" /></form>

------------------------------------
upload.php:


PHP Code:
<?php
$uploadDir
= '/var/www/uploads/';
$uploadFile = $uploadDir . $_FILES['userfile']['name'];
print
"<pre>";
if (
move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadFile))
{
print
"File was successfully uploaded.\n";
}
else
{
print
"Error\n";
}
print
"</pre>";
?>


I dont have much experance with codeing so if anyone can help getting one up and running i will be more than happy to reward you with $30 via paypal for your help. I need this done ASAP, or if you can point me in the right direction on where i can get one from.
if you need to get in contact me with msn or email ssaaiinnttss@hotmail.com or just email me. thanks
danny
CircleOfLinks is offline
Reply With Quote
View Public Profile Visit CircleOfLinks's homepage!
 
 
Register now for full access!
Old 08-01-2006, 03:53 AM Re: uploading script problem, will pay $30 if someone set it up for me.
saadatshah's Avatar
Extreme Talker

Posts: 215
Name: Syed Saadat Ali
Location: Lahore, Pakistan
Trades: 0
The script is correct. kindly check the directory permisions in which you are uploading the files you have set the read, write, delete permissions to the folder it might be chmod 777 in linux servers. I think problem is with your directory permissions thats why you are getting the Error message. There is no proper error dumping is made.

kindly use this script instead of the script you are using.

PHP Code:
<?php
$uploadDir 
'/var/www/uploads/';
$uploadFile $uploadDir $_FILES['userfile']['name'];
print 
"<pre>";
if (
move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadFile))
{
print 
"File is valid, and was successfully uploaded. ";
print 
"Here's some more debugging info:";
print_r($_FILES);
}
else
{
print 
"Possible file upload attack! Here's some debugging info:";
print_r($_FILES);
}
print 
"</pre>";
?>

Also you can read these articles for further help.

Uploading Files with PHP > upload1.php

Introduction - Uploading files in PHP - Developer Fusion, the UK developer community - VB, ASP, C#, .NET, PHP and XML tutorials & source code

NetSpade - Uploading Files with PHP

Hope it will help you and save you $30 . HAPPY PROGRAMMING!
__________________
- -- --- ---- ----- ------ ------- ---------------
If you have knowledge, let others light their candles in it.
saadatshah is offline
Reply With Quote
View Public Profile Visit saadatshah's homepage!
 
Old 08-02-2006, 02:12 PM Re: uploading script problem, will pay $30 if someone set it up for me.
Dale Hodge's Avatar
Skilled Talker

Posts: 63
Location: Syracuse, ny
Trades: 1
The problem is probably the uploaddir path. If you got this script from another thread
then maybe you used their default path. The script is revised below and should solve your
problem. Best of luck, Dale.


PHP Code:
<?php
$uploadDir 
="$_SERVER['DOCUMENT_ROOT']" ."/uploads/";
$uploadFile ="$uploadDir"$_FILES['userfile']['name']";
print 
"<pre>";
if (
move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadFile))
{
print 
"File is valid, and was successfully uploaded. ";
print 
"Here's some more debugging info:";
print_r($_FILES);
}
else
{
print 
"Possible file upload attack! Here's some debugging info:";
print_r($_FILES);
}
print 
"</pre>";
?>
Dale Hodge is offline
Reply With Quote
View Public Profile
 
Old 08-03-2006, 11:33 AM Re: uploading script problem, will pay $30 if someone set it up for me.
saadatshah's Avatar
Extreme Talker

Posts: 215
Name: Syed Saadat Ali
Location: Lahore, Pakistan
Trades: 0
Did you try the solutions?
__________________
- -- --- ---- ----- ------ ------- ---------------
If you have knowledge, let others light their candles in it.
saadatshah is offline
Reply With Quote
View Public Profile Visit saadatshah's homepage!
 
Reply     « Reply to uploading script problem, will pay $30 if someone set it up for me.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.14193 seconds with 12 queries