Hi Rick,
I have a problem with AddPostFile
nHTTPPostMode = 2
AddPostFile ("file", m.File .T.)
My file name is not converted to UTF-8 and if I convert it with strconv (m.File, 9), addPostFile does not find it ("THIS.oPostStream.Write( FILETOSTR(FULLPATH(tcValue)) )")
Thanks in advance

The filename can't be Utf-8 encoded - it has to be an actual match to what's on disk. If you can't represent it with your active character set in VFP, that's a problem at the FoxPro level that I'm not sure you can work around.
What's the concern here exactly?
I am wondering now if there might have to be some additional encoding at the HTTP header level when the filename (just the actual name, not the path) gets embedded into mime header.
+++ Rick ---
Thank you for your answer.
In the naming of my files, I use French accented characters.
Fortunately, I discovered that there was an optional tag in the application allowing to enter the name of the file (in UTF-8 of course)
I take this opportunity to tell you that in another application, I was able to use the 4th parameter (tcContentType), very useful !
Vincent
Hmmm... can't you use the file name as is? What happens if you do?
If anything the filename probably needs to be UrlEncoded not UTF8 encoded.
? Urlencode("café.txt")
// caf%E9.txt
I'll have to check up on this. If it has to be encoded this should probably be done automatically as part of the upload encoding.
+++ Rick ---
Please pardon me for jumping in...
I suggest that you show us some file names which are rejected.
No problem, thanks. For example:
loi alur - remise en mains propres des documents de la copropriété - aaa_xxxxxxxxxx[1].pdf
So I'm checking into this and it looks to me that browsers are in fact encoding filenames to UTF-8 as you mention.
I've fixed this in wwHttp
so now the filenames for oHttp.AddFile()
will automatically Utf-8 encode the filename.
This also needs a fix on the Web Connection end for wwRequest.GetMultipartFile()
and wwRequest.GetMultipartFiles()
both of which were not decoding the UTF-8 encoding of the file.
It'll be in the next release.
Thanks for the heads up. Amazing we've not run into this before.
+++ Rick ---