Prblem uploading file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kenyaz
Forum Newbie
Posts: 6
Joined: Tue Oct 07, 2003 4:38 pm

Prblem uploading file

Post by kenyaz »

I am trying to get an application to work under PHP on our windows server.

The file, when uploaded, is supposed to be a key file and so it is just text however the extension for it is .PHP.

Uploading to my root folder and view the key.php file displays as it should.

However, when I upload into a folder, it shows differently and in not the format that it is supposed so that it is recognized by the program.

For example:

Properly loaded in Root folder:
-----------BEGIN KEY-----------
asdfadasdasdasdasdasd
asdasdasdasdasd
-----------END KEY--------------

Uploaded into the Application folder, the same file shows as:
-----------BEGIN KEY-----------asdfadasdasdasdasdasd
asdasdasdasdasd-----------END KEY--------------

Any ideas how to make this work? Seems to only display like this when it is in any folder other the the root folder.

Thanks
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post by Gen-ik »

Without seeing the code (or part of it) it's hard to tell what the problem might be. At the moment I would say it has something to do with newline and carriage-return characters (\n\r).
kenyaz
Forum Newbie
Posts: 6
Joined: Tue Oct 07, 2003 4:38 pm

Post by kenyaz »

Thanks, the code is basically what I listed above, it is really a text file with the PHP extension. That's it. For some darn reason though, when it is uploaded to inside of a folder, it changes the format.
kenyaz
Forum Newbie
Posts: 6
Joined: Tue Oct 07, 2003 4:38 pm

Post by kenyaz »

Figured something out. No idea how to make it work though.

If I turn off the php extension for that folder, the I can pull the key up as it should be. But I need php to run on that folder. Is there anyways to disable it for one file?
kenyaz
Forum Newbie
Posts: 6
Joined: Tue Oct 07, 2003 4:38 pm

Post by kenyaz »

Does anyone have any idea how why this happens?

Yesterday I installed a different PHP application on our server and it has a license file and it reads correctly.

But this one in this particular directory does not. There must be something simple that is wrong.
User avatar
Wizard
Forum Newbie
Posts: 15
Joined: Sat Oct 11, 2003 3:37 am
Location: Latvia

Post by Wizard »

In some sites is big problems to upload avatars.
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

you could upload the file to a temp folder, open it and format to your needs, after that save it where ever you want it to be and delete the temp file.
Post Reply