file upload not working |
[eluser]learning_php[/eluser]
Hi, I am trying to get a file upload working but it keeps telling me that the file path is not valid. I a have folder called upload with full permissions so i am a little stuck. Code: function upload(){
[eluser]Dam1an[/eluser]
I think you need the forward slash on the end of your upload path
[eluser]learning_php[/eluser]
I changed it to this but i get the same error: Code: $config['upload_path'] = './wedding-site/assets/upload/';
[eluser]Dam1an[/eluser]
Oh ![]() I just saw the page in the user guide had a forward slash and you didn't so assumed that was it Is the invalid path a PHP error, or one produced by CI (when you reload the upload view)
[eluser]learning_php[/eluser]
It happens with I load the upload.php view page which only contains the code to either print the error or redirect to another page. Code: <?PHP
[eluser]Dam1an[/eluser]
Try using the file helper to write a file (some random text) to you upload directory, see if that works... That might give a clue as to where the problem lies
[eluser]learning_php[/eluser]
Hi, i added to the upload view: Code: <?PHP and now it displays The upload path does not appear to be valid. Unable to write the file
[eluser]Dam1an[/eluser]
Have you tried giving it an absolute file system path, instead of one relative to index.php
[eluser]learning_php[/eluser]
Hi, When i give use this it writes the file? Code: $data = 'Some file data';
[eluser]learning_php[/eluser]
Hi, I have been reading the forum post and it seems other people have had the same error and it seems that changign the line to this works Code: $config['upload_path'] = './assets/upload'; |
Welcome Guest, Not a member yet? Register Sign In |