This topic is locked
[SOLVED]

 Upload file - absolute path

9/22/2011 3:04:50 PM
PHPRunner General questions
J
Jsnop author

I am having trouble setting the correct path in the file/image edit as and view as entry box. I want to set a absolute path to a location on my C:\ drive. I have the absolute path check box checked and I have the correct path (I believe) "C:\xampp\htdocs\media". But when I submit the record in the Add screen, I am getting the following PHP error:

php error happened

Technical information

Error type 2

Error description move_uploaded_file(C:\xampp\htdocs\media/header2.png) [function.move-uploaded-file]: failed to open stream: No such file or directory

URL xxxxxx/media_add.php?

Error file /home/xxxxxxxxx/include/phpfunctions.php

Error line 570

SQL query insert into media (mediaType, filename, title, bannerText, mediaActiveUser) values ('Text', 'header2.png', 'test file', 'check it', 1)
It looks to me like the code is placing a forward slash instead of a backslash when it is setting the directory it is trying to load the file to...C:\xampp\htdocs\media/header2.png
Does anyone know how to fix this so that the file will load properly to a folder on my C drive?
Thanks

Admin 9/22/2011

You need to make sure

  1. Directory C:\xampp\htdocs\media exists
  2. Web server user has write permissions on this directory.
    If this doesn't help post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.

J
Jsnop author 9/22/2011

The directory exist and I believe the Web server user has write permissions on this directory. Is the way I'm trying to run this causing the issue? Here's what I'm doing:
I have the main PHPrunner application located on a web server at a "http://..."; address on the web. I am trying to have the file that ANY user tries to upload, be placed on THEIR hard drive. So in other words, even though the page they are on is "on the web", the file that the database will reference will actually be on their hard drive.
Any help in making this happen will be appreciated. Thanks.
Jeff

Admin 9/22/2011

This doesn't make any sense. "Upload" means file from client's computer is transferred to the server. You cannot manipulate files on client's computer.