kirchaj
Posts: 215
|
| Posted: 09/17/2007, 9:35 AM |
|
Ok, I really need some help here. I have created a system with Codecharge where our students can upload files to our server to demonstrate proficiency. All works really well except for when there are special characters like the # sign. The url that points to the file looks to be correct. The file exists on the server and matches the link in the database. But when you try to download the file is comes up with the following
The requested URL uploads/xxxxxxxxxxxxx/200709170106190.PSY 310 CRITICAL PERFORMANCE was not found on this server. and truncates after the # sign.
So, First I am looking for options to solve this problem. Is there a way to make this work? If not, what would be the best way to solve this problem? My first reaction is to somehow (could use an example) to produce an error and not allow the file to be uploaded if it contains a character that may cause a problem.
Any other ideas?
Thanks
TK
|
 |
 |
DonP
|
| Posted: 09/17/2007, 10:08 AM |
|
Spaces and certain special characters are not allowed in Web file
naming-convention whether they are images, HTML, or anything else, and will
usually truncate at the point where such things are found. If the file names
have spaces or special characters, try removing them or replacing them with
underscores and see if it helps. If it does, you can add programming to do
this automatically, which is often necessary when non-technical people are
using forms for uploading documents.
DonP
"kirchaj" <kirchaj@forum.codecharge> wrote in message
news:546eeacd3d77b7@news.codecharge.com...
> Ok, I really need some help here. I have created a system with Codecharge
> where
> our students can upload files to our server to demonstrate proficiency.
> All
> works really well except for when there are special characters like the #
> sign.
> The url that points to the file looks to be correct. The file exists on
> the
> server and matches the link in the database. But when you try to download
> the
> file is comes up with the following
>
> The requested URL uploads/xxxxxxxxxxxxx/200709170106190.PSY 310 CRITICAL
> PERFORMANCE was not found on this server. and truncates after
> the #
> sign.
>
> So, First I am looking for options to solve this problem. Is there a way
> to
> make this work? If not, what would be the best way to solve this problem?
> My
> first reaction is to somehow (could use an example) to produce an error
> and not
> allow the file to be uploaded if it contains a character that may cause a
> problem.
>
> Any other ideas?
>
> Thanks
> TK
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
kirchaj
Posts: 215
|
| Posted: 09/17/2007, 11:17 AM |
|
Thanks for the insight.
Does anyone have an example of a way to change the naming of the file so that it can be uploaded and downloaded correctly.
OR an example that would find the problems and produce an error message for the user?
Thanks again.
TK
|
 |
 |
leosweden
Posts: 61
|
| Posted: 09/17/2007, 12:57 PM |
|
Hello
Well, i think the answer is to write the file name without special characters.
frank#324.exe is not good idea. This is better franknr324.exe
Just use the alfabet and numbers. You could maybe use _ (underscore) instead of a blankspace.
frank_nr_234.exe instead of frank nr 324.exe
Leo
|
 |
 |
kirchaj
Posts: 215
|
| Posted: 09/17/2007, 1:32 PM |
|
That is exactly what I would like to do, but am not sure how to make it happen. Anyone done this already?
Thanks.
TK
|
 |
 |
Hidran
|
| Posted: 09/18/2007, 6:24 AM |
|
$str=eregi_replace("([^a-z0-9])","_",$string);
Hidran
"kirchaj" <kirchaj@forum.codecharge> ha scritto nel messaggio
news:546eee47ac8d3b@news.codecharge.com...
> That is exactly what I would like to do, but am not sure how to make it
> happen.
> Anyone done this already?
>
> Thanks.
> TK
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
|