Jump to content

Recommended Posts

Dear all,

 

I'm quite a php noobie, have used a tutorial to construct a php image uploader. Though I'm now faced a problem regarding the directory where the image is uploaded to...

 

I have the variable $folder which holds the address of the web folder in which the image is to be uploaded to... However the image will only upload when this variable is set to a folder which is in the same folder as the upload script.... for example I have a secure area/folder called CMS, in this I have the upload file and the upload folder (images), however I don't want to the upload folder to be in the secure area (as it wouldn't allow visitors to see the images) so instead I have tried changing the variable to say

 

$folder = "http://www.myhost.co.uk/images/";

 

instead of

 

$folder = "http://www.myhost.co.uk/CMS/images/"; (which works fine)...

 

Does this mean I have to upload to wherever my script is?

 

Thanks in advance :)

 

Ryan

Link to comment
https://forums.phpfreaks.com/topic/72098-solved-image-upload-directory-problem/
Share on other sites

yes, you have to upload to where ever your script is, your better off making your secure folder just a normal folder, and make a login script for people to access different folders. Works better, it may take awhile to code, but its much more effective.

 

Regards ACE

No; you don't have to..

But use "../" to get from a folder to another..  Example:

the script path: /alfa/beta/upload.php

Wanted image path: /alfa/charlie/images/

then you have to set $folder = '../charlie/images/';

 

../ means "one directory down"

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.