Re: upload file issue




"Emmanuel Petit" <emmanuel.petit26@xxxxxxx> wrote in message
news:4624da1f$0$18315$426a74cc@xxxxxxxxxxxxxxx
First of all I am rather new into PHP. I use php 5 and I am putting
together a web site for a local association I belong too.
Most of the site is okay, except for this problem :

I need to be able for the member of the site to upload files (gif, jpg or
pdf). After reading a lot about the danger of file uploading, I decided to
create a folder at the root of the web server. The upload of the files
goes on without any problem, but when i tried to show some of the file
(such as the image files), the system does not retrieve them.

Here is the the tree of my web server :
/.
/website (folder where all of the web site is build with *.php files)
/uploads
/images (folder where all the images files are uploaded)
/pdf (files where all the pdf files are uploaded)

The bit of code doing the uploads works fine, but I can not find a way to
retrieve the files. When I code in the php file :
echo '<img src="../uploads/images/test.gif">';
The browser is in fact looking for a file name
www.mywebsite.com/uploads/images/test.gif which of course does not exist.

I tried to look on the web for an answer but did not find one. Could any
one points me out to a tutorial for this subject, or will be good enough
to help with a solution, bearing in mind that I am by no mean an expert in
php.

Thank you.

I am sure that there may be another solution, but I think that you cannot
path back outside of your webserver. I'd bet that if you moved the 'uploads'
folder inside the 'website' folder and change the link accordingly, it would
work.

As www.mywebsite.com and the website folder should be the same ... I take it
that having <img src='../../uploads/images/test.gif'> makes no difference?




.



Relevant Pages

  • Uploading to a folder outside the www ... ?
    ... users to upload images for others on the site to view. ... I found some ASP.NET code on a developers web site which seems to do exactly ... that permissions would need to be set on the folder where the images were to ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: Hyperlink works w/ Word but not Pub 2007
    ... This is the same folder which has the pub web site files. ... The PDF file was also uploaded to the same server. ... Upload the pdf file if not already there. ...
    (microsoft.public.publisher)
  • Re: Visual Web Developer Express How do I build Code-behind into DLL in bin folder
    ... > choose Build Web Site from the Build menu, and then be sure to upload ... > the resulting /bin folder along with the rest of your site. ... need to upload our program source files; ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: UPLOADING IMAGES (PHOTOS AND GRAPHICS) TO THE WEB SITE
    ... It sounds like you did not upload all the html output. ... index.htm file and an index_files folder is produced. ... OK SO OBVIOUSLY THEY WERE NOT SENT UP TO THE WEB SITE WHEN IT WAS ... PLEASE COULD SOMEONE TELL ME HOW TO GET THEM THERE USING MS PUBLISHER. ...
    (microsoft.public.publisher)
  • Re: Manually Created Web Site Does Not Work - What am I Missing?
    ... For each different Web site ... have the same name or folder structure as my VS project. ... The ASP.NET Dev Server runs as the Administrator account in VS 2008. ...
    (microsoft.public.dotnet.framework.aspnet)