Jump to content

Can't Upload A File To A Directory........

Recommended Posts

Hope this is the right forum............


Using CodeCharge Studio to develop a PHP based project which includes a file upload module on a HTML page. When I access the page from my website I receive an error within the page, which is normal if there is a problem, stating "Upload folder doen't exist". I have created the folder in question, did a chmod 777 on the directory. I am using /home/XXXXX/....... as the path. I got this from the file manager in Cpanel.


First question - I am on a shared server, do you have 'open base dir restriction' setup which means I can't access sub-directories from outside Cpanel or ftp?


Second question - If I don't know what I am talking about, could you please point me in the right direction with path and permisions to allow me to upload a file from a web page.


If you need additional info, please let me know.



Thanks for your help,

Link to post
Share on other sites

Hi Chip :)


The reason is usually because you have put a / in the wrong place, and hence got the path wrong.


For example if you are in /home/x1x1x1/public_html and you want to upload to the folder folder1 with file aaa


You can either write







/folder1/aaa would be the wrong place, because of the / at the beginning - and hence you wouldn't have permissions there.


Can you paste the full error message for us ? (crossing out any personal information of course)

Link to post
Share on other sites

Thanks Andy,


Putting too many "/" and directory names into my path. You made me think what directory my page was running in and just put in the name of the directoy I wanted to save the file to. The directory for saving the file was a sub-directory. Page was running in www/demotest, all I needed to use for a path was "pcrimage".


You guys are awesome as always, Thanks!

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...