Page 1 of 1

Upload folder created twice

Posted: Sat Aug 31, 2024 4:39 pm
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.


Re: Upload folder created twice

Posted: Sat Aug 31, 2024 11:27 pm
by mobhar

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


Re: Upload folder created twice

Posted: Sun Sep 01, 2024 1:52 am
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.


Re: Upload folder created twice

Posted: Mon Sep 02, 2024 4:07 pm
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).


Re: Upload folder created twice

Posted: Mon Sep 02, 2024 4:27 pm
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>

Re: Upload folder created twice

Posted: Mon Sep 02, 2024 5:33 pm
by sangnandar

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


Re: Upload folder created twice

Posted: Mon Sep 02, 2024 7:22 pm
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:\").


Re: Upload folder created twice

Posted: Mon Sep 02, 2024 8:16 pm
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>


Re: Upload folder created twice

Posted: Mon Sep 02, 2024 9:09 pm
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.

Re: Upload folder created twice

Posted: Mon Sep 02, 2024 9:55 pm
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.


Re: Upload folder created twice

Posted: Tue Sep 03, 2024 12:11 pm
by Webmaster

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