Upload folder created twice

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
sangnandar
User
Posts: 1031

Upload folder created twice

Post by sangnandar »

Using

  • phpmaker2024: latest version, latest template
  • project file: demo

Advanced Settings
Web root relative path: Default ("." without quotes)
File upload path (absolute) for temporary files: Default (empty)

PHP Settings
Upload folder: upload/

Project folder
C:\xampp\htdocs\demo\

Generate completed successfully without errors.

PROBLEM
Upload folder created twice: C:\xampp\htdocs\demo\upload (expected) and C:\upload (not expected)

Any ideas of what is the possible cause of this problem?

Thank you.


mobhar
User
Posts: 11905

Post by mobhar »

Did you see both upload folder have the same uploaded files, too?


sangnandar
User
Posts: 1031

Post by sangnandar »

No.
C:\upload is always empty.
C:\xampp\htdocs\demo\upload works as expected. CRUD operations (of files) work as expected with this folder.


sangnandar
User
Posts: 1031

Post by sangnandar »

I did clean install all softwares (windows 10, apache 24, php 8.3, node, composer, etc). The problem still persisted.
I'm using VMware.

What is the script (inside the template) which create this folder?
I observed that folders log and upload was created during compilation of .pmp (before the actual files generation).


arbei
User
Posts: 9787

Post by arbei »

You better check your Apache config file under C:\xampp\apache\conf\httpd.conf, make sure you use correct Windows paths for your XAMPP installation, not Linux paths (starting with "/"), e.g.

DocumentRoot "C:/xampp/htdocs"
<Directory "C:/xampp/htdocs">
...
</Directory>

sangnandar
User
Posts: 1031

Post by sangnandar »

Tried both Windows path ("C:\xampp\htdocs") and Linux path ("C:/xampp/htdocs").
Restart apache, restart machine.
The problem still persisted.


arbei
User
Posts: 9787

Post by arbei »

Double check your upload folders (which are paths relative to the project folder) in your project, make sure they are not absolute paths (i.e. they do not starts with "/" or "C:\").


sangnandar
User
Posts: 1031

Post by sangnandar »

PHP -> General Options -> File Upload -> Upload folder = upload/

If I change the value to anothername/ the behavior is still persisted. It will create folder anothername twice, both in C:\ and C:\<project folder>


arbei
User
Posts: 9787

Post by arbei »

I cannot reproduce, you may want to delete the C:\upload and then upload a file again, see after which step the folder is created. Also post more info, e.g.

  • Upload to folder or database? Multiple file upload or single?
  • Upload in which page?
    etc.

sangnandar
User
Posts: 1031

Post by sangnandar »

I generated project demo2024.pmp as is with only few changes:

  • change connection strings (as mentioned in readme.txt).
  • uncheck tables locations, locations2, and locations3 (due to googlemaps API and leaflet)
  • enable Debug

Generate completed successfully without errors.
The only strange behavior is that it created folder C:\upload

Generated apps looks goods.
C:\xampp\htdocs\demo\upload works as expected. CRUD operations (of files) work as expected with this folder.
CRUD operations was done using http://localhost/demo/employeeslist (employee photo). Add, edit, and delete pages works as expected.

C:\upload is always empty, during CRUD operations of employee table.
Deleting folder C:\upload has no effect, CRUD operations of employee table still working as expected.

However, folder C:\upload always re-created each time I re-generate the app.


Webmaster
User
Posts: 9438

Post by Webmaster »

Cannot simulate. If you are a registered user, please send your project file to the support email for checking.


Post Reply