Can this be incorporated?
I'm a newbie.. er newby when it comes to php. sql etc.
I am presently using a oscommerce shopping cart. I loaded a contribution called customer add product. I loaded it up and everything seems to work fine. All except for the images will not upload. I've attemted to make little changes here and there and have been searching for answers as to why,
but nothing. The contribution does work for other people.. so I am so confussed at what to do right now. I don't know what is causing the problem or how to turn it around.
The images are suposed to load in a shop/images/thumb folder with permision set on 777 I have that and it still doesnt work.
Im wondering if I am missing something either in sql or my root folder which enables this. Am I suposed to have an upload_image.php like the one your describing here? I've completed a search in my folders and I don't seem to have one. atleast not by the same name. Could I load these files into the oscommerce cart? Would it make a differnce or crash it?
MY head is so fried Im not even sure what I should be asking.
Just any information about sql , php and image uploading might boot me in the proper direction.
If anyone wanted to take a look at the site before I destroy it completly
This tutorial is for people that want to allow their visitors to upload image to their webite. If you are uploading images to your own site you should use an FTP client.
I think you should start a new thread. Try to narrow things down to one section of code you think is faulty and post that along with your explanation.
hi bokeh et al!
i extended your fabulous script to an news upload script with optional image upload and a event script where one can upload a additional infosheet as pdf optionally.
the only drawback is that when there is an error (like file too big or no event title given) the form gets reloaded and the user has to type in all the details again from scratch..
if so, how could this be implemented?
Originally Posted by jogol
Last edited by bokeh; 05-12-2006 at 05:58 AM.
I getting the error: "'receiving directory insuffiecient permission'"
What should I do to fix it?
Give the folder's permission 777 in FTP.
Or entering into the cpanel->Files->www->Upload Folder--> Change the permission as 777.
Then you can do it.
Do it like this way.
That is depracated. Use $_FILES
Originally Posted by john_de116
Thanks both of you for your replies; however, I'm using dreamweaver MX to upload the files, and I cannot follow your steps. Would you please give me more details. Thanks.
Bokeh thanks for this great script.
You need to use your FTP client (the program you use to uploaded your scripts) to select the directory that recieves the files and change it to 0777 permission.
I ftp through the web address and allowd all persmissions for owner, groups, and users to he uploader folder; However, I'm still receiving the same error message. My guess is that I'm failing to giving permissions to the correct file/folder.
Should I modify any part of the script?
for example in the upload.processor.php file:
// fieldname used within the file <input> of the HTML form
$fieldname = 'file';
=> shouldn't instead of the name 'file', I have to create a folder to place the images that are going to be uploaded, and put the name there?
Thanks for your help.
You need to set the permission of the receiving directory to 0777 not the uploaded folder.
Originally Posted by lapfama
Last edited by lapfama; 07-23-2006 at 01:17 PM.
I can't get this to work
Originally Posted by Sheldon
I'm sure i'm just doing something wrong, but i've tried everything...
my script looks like this.
and i'm getting this error
// now let's move the file to its final and allocate it with the new filename
or error('receiving directory insuffiecient permission', $uploadForm);
//in addition to Bokeh's script you can insert each record into a database.
$conn = mysql_connect("localhost","Munkeyman","hgfjde34583")
or die("Could not connect to MySQL");
$db = mysql_select_db("images",$conn)
or die("Could not select database");
$q = "INSERT INTO uploaded_images (`filename`,`date`) VALUES ('$uploadFilename',$date(dMy))";
$s = mysql_query($q, $conn);
//if an error
// If you got this far, everything has worked and the file has been successfully saved.
// We are now going to redirect the client to the success page.
header('Location: ' . $uploadSuccess);
Unknown column 'dMy' in 'field list'
Warning: Cannot add header information - headers already sent by (output started at c:\Apache\htdocs\Dinamic uni\uploader\new.upload.processor.php:69) in c:\Apache\htdocs\Dinamic uni\uploader\new.upload.processor.php on line 73
my database looks like this..
If any one can help me it would be much appreciated!
mysql> use images;
mysql> show tables;
| Tables_in_images |
| uploaded_images |
1 row in set (0.00 sec)
mysql> explain uploaded_images;
| Field | Type | Null | Key | Default | Extra |
| id | int(11) | YES | | NULL | |
| filename | varchar(50) | YES | | NULL | |
| date | varchar(50) | YES | | NULL | |
3 rows in set (0.00 sec)
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)