I've been testing on uploading files and I encountered a weird bug while testing it out because on the initial uploading of the file, my localhost uploads it to the root directory of my xampp rather than in the directory inside my htdocs folder. To make things clear here's what happened.

1.) I upload my file from a page in http://localhost/fileupload/upload.html, which is equivalent to my "C:\xampp\htdocs\fileupload" directory.

3) After the initial upload the file is stored in the "C:\xampp" folder instead of the fileupload folder mentioned above.

4) I tried uploading again, that's when it stores the uploaded files to my uploaded folder.

5) When I deleted the copy on the "C:\xampp" folder and uploaded the file again, it's there again and it didn't replace the copy on the "C:\xampp\htdocs\fileupload" directory.

From this, I deduced that if it doesn't see a copy of a file in the "C:\xampp" directory, the upload goes there. If the file exists, that's the only time it uploads it to the same directory as my page. Is this a config issue or a security issue? Can anyone shed some light on this matter?

Thanks,

Joni

Recommended Answers

All 2 Replies

Might be the current working directory issue. Try specifying absolute path when copying the uploaded file.

hai jblacdao
Sorry I am not clear what u mentioned ur mail
Can u please expline again clearly

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.