When I try to copy and add the "upload" in Redline function, I got this error "The specified file was not found:" Anyone has suggestion?
If you set display_errors = On in your php.ini you should get much more "noisier" errors in the Redline widget giving you something more to work with.
- Jackie
Thank you Jackie. What I want to do is steal your PHP code and make a function only download/upload kml/kmz file from map. PHP is so different with ASP.NET, thank you for help me.
I turned display_errors = On, still get same error message. In my laptop I copied your code, it works fine; but I copied to Server, it gives me this error "The Specified file was not found:" So I added one line code in uploadmarkup.php file at line 54 (before "return true;") in the function "CheckFileName()": alert(document.getElementById("uploadFile").value);
In my laptop, it always display "C:\fakepath\test.sdf"; the path doesn't change with the file location change;
In the Server, it shows the direct path, like "C:\Users\Desktop\test.sdf" , or "C:\Users\download\test.sdf"; the path changes;
For fireFox, both display only the file name without path.
So I think the reason maybe the path. Then I added one line in function UploadMarkup() from markupmanager.php(about line490):
print($_FILES["UPLOADFILE"]["name"]);
laptop shows "C:\windows\Temp\phpEDFF.temp" or "C:\windows\Temp\php7C5A.temp"; it looks created a temp file in temp folder; I can found these temp files.
Server shows "test.sdf" which is the exact name of the file that I want to upload; stil in the server it also try to create a temp file like php55DD.tmp, phpDF93, but they are all empty
Could you help me to point the next step that I can do to fix this porblem?
Another issue is the labels not show, probably due to soem variables cannot pass or exist, I have to hard code it to display, for example: in markupmain.php, I changed line 295 to "<input class="Ctrl" type="button" id="uploadBtn" onClick="SubmitCommand(CMD_UPLOAD)" value="Upload" style="width:85px">", otherwise "Upload" doesn't display enev I copied all the dependency files (under .../layers/MapGuide/php: Common.php, Constants.php, Utilities.php). Thank you very much.