Error with save path on file upload
Archived from the Xataface Users forum.
Atochex — Thu Apr 10, 2008 12:01 pm
Hi,
I have searched the forum for an answer and found one blog similar to this one but still, after two days of messing, was not able to figure it out.
I am running LAMP on my windows XP PC.
Folder structure:
Dataface location:
D:\xampp\htdocs\myphp\PHPGenerators\xataface
Application location:
D:\xampp\htdocs\myphp\PHPGenerators\idxceo_engine
Location of Dataface index.php within application (renamed to admin.php):
D:\xampp\htdocs\myphp\PHPGenerators\idxceo_engine\admin
Desired file upload dir:
D:\xampp\htdocs\myphp\PHPGenerators\idxceo_engine\SiteEngine\plugins\main\blocks
Content of admin.php
- Code: Select all
require_once '../../xataface/dataface-public-api.php'; df_init(__FILE__, 'http://localhost/myphp/PHPGenerators/xataface'); $app =& Dataface_Application::getInstance(); $app->display();
Content of fields.ini:
- Code: Select all
[block_file] Type = container widget:label = "Block File" widget:description = "Upload a Block File from your system" widget:type = file allowed_extensions = html,php savepath = ../SiteEngine/plugins/main/blocks url = http://localhost/myphp/PHPGenerators/idxceo_engine/Site_Engine/plugins/main/blocks
It throws the following error:
Warning: mime_content_type(D:\xampp\htdocs\myphp\PHPGenerators\idxceo_engine\admin/../SiteEngine/plugins/main/blocks/home_sidebar1.blk.php) [function.mime-content-type]: failed to open stream: No such file or directory in D:\xampp\htdocs\myphp\PHPGenerators\xataface\Dataface\Record.php on line 2182
It looks like it takes the folder that contains the xataface admin.php (previously index.php) file as the root for the new upload URL. Maybe because of some $_SERVER[‘PHP_SELF’]?
I would greatly appreciate any help.
Thank you very much.
Chris
shannah — Fri Apr 11, 2008 6:54 am
It throws the following error:
Quote:
Warning: mime_content_type(D:\xampp\htdocs\myphp\PHPGenerators\idxceo_engine\admin/../SiteEngine/plugins/main/blocks/home_sidebar1.blk.php) [function.mime-content-type]: failed to open stream: No such file or directory in D:\xampp\htdocs\myphp\PHPGenerators\xataface\Dataface\Record.php on line 2182
When does it throw this error? When you’re uploading an file, when your trying to view a previously uploaded file, or other?
-Steve
Atochex — Fri Apr 11, 2008 2:27 pm
Thanks a lot for your reply Steve.
Oops, apology, I forgot to mention that it happens when I try to edit or view any record of the table that contains the upload field (with any existing files and also when I try to upload a new file).
Thanks.
Chris
Atochex — Fri Apr 18, 2008 1:09 am
When does it throw this error? When you’re uploading an file, when your trying to view a previously uploaded file, or other?
Oops, apology, I forgot to mention that it happens when I try to edit or view any record of the table that contains the upload field (with any existing files and also when I try to upload a new file).
I was wondering if you had any time to look into this matter?
Thanks.
Chris
shannah — Sat Apr 19, 2008 7:52 am
The error doesn’t look like it has anything to do with the save url, just the save path.
Can you confirm that the file is actually being saved on upload? The error indicates that the file could not be found, which would mean that either it wasn’t successfully uploaded, or the path is wrong.
Another note is that allowing users to upload php files is a potential security hole, as they could upload a script that did some bad stuff, and then immediately call that script.