|
||||||
| PHP Tutorials PHP Tutorials |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||||
|
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog Post a job on our freelance section! Paste between computers/devices and Collaborate on Code!. |
|
|||
|
Its a great script... would it be possible to upload multiple images using one submit button only? I tried but it did not work...can you help me... show me how to do it ... thanks so much |
|
|||||
|
Yes, in the HTML you will need to specify the image variable as an array: HTML Code:
<form enctype="multipart/form-data" action="insert.php" method="post" name="changer"> <input name="MAX_FILE_SIZE" value="102400" type="hidden"> <input name="image[]" accept="image/jpeg" type="file"> <input name="image[]" accept="image/jpeg" type="file"> <input name="image[]" accept="image/jpeg" type="file"> <input name="image[]" accept="image/jpeg" type="file"> <input value="Submit" type="submit">
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog Post a job on our freelance section! Paste between computers/devices and Collaborate on Code!. |
|
|||
|
I can't get this script to work. Everytime I try to upload an image, I get the following error: No image selected/uploaded. Is there a problem with the script? Edit: Stupid me. I had set the maximum filesize way too low! ![]() So now it's working! ![]() Thanks for the tutorial! ![]() |
|
|||
|
Hi I have followed all the steps and I understand the concept behind uploading and displaying an image(according to Jaan), however the image still does not display for me. I believe the problem is with the rights of the file or something. The reason why I think so is because i have tried uploading an image to the "uploads" folder with ftp and i can easily display it however if i upload the same exact image with the upload form and then i try to view it I get the following message "403 Forbidden". If it makes any difference I am using a hosted site. Any idea why when i upload an image with the upload form it becomes forbidden in the folder? Thank you Very much in advance |
|
|||||
|
A 403 means you can't access your PHP script. You probably have bad permissions, as you stated. chmod 755 it and try again.
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog Post a job on our freelance section! Paste between computers/devices and Collaborate on Code!. |
|
|||
|
So what permission rights must a folder technically have? Initially i had the following permissions: (and if you chmod 755 it this is how permissions will end up) Me: Read and Write Staff: Read only Everyone: Read only then I changed them to Me: Read and Write Staff: Read and Write Everyone: Read and Write and still get the forbidden message. Btw I have the following setup: mywebsite.com contains a folder "uploads" mywebsite.com contains all of my php pages I am trying to store just the path in the database and the actual image files in the upload folder. I host my website, so in order to make sure that my folder(uploads) had read and write access rights(which i assume are correct) i have created it on my computer and then sent it with ftp to my host. So I assume the folder still has the correct permission rights set up. It is weird that it works fine if i ftp and image (i am then able to view it). But if i use the uploads form it does get uploaded but i cant view it and get that "forbidden" message. Thank you so much for your help! |
|
|||
|
Hi Jordan! thanks for help. So I discovered that after I upload my image with the file upload form, the actual image's permission settings change. They change to no read rights. Therefore somewhere in my upload form i have to chmod 755 the actual file but I am not sure how to do so. Could you please help me out? and here is the code I have to actually upload the image: PHP Code:
Last edited by Jaan; 05-31-2009 at 06:29 PM.. Reason: Please use code tags when you are posting your codes! |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Tutorial: PHP to MySQL | Jordan | PHP Tutorials | 9 | 09-05-2008 12:12 PM |
| John's Java Tutorial Index | John | Java Tutorials | 0 | 01-11-2007 03:05 PM |
Algorithms and Data Structures
Programming Language Popularity
Code Collaboration
Podnet IRC Network
AmpHosted
Goal #1: 1,000 Blogs
Goal #2: 1,000 Wiki Pages
Goal #3: 300,000 Posts
Goal #4: 20,000 Threads
Done: 30%, 23%, 55%, 75%