Re: Put document and FileName

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



You are still not in the Programming newsgroup.

If you want to write in Spanish, post SharePoint questions to microsoft.public.es.sharepoint. (I hope that is the correct name)

Mike Walsh



Berrocoso wrote:
On 11 abr, 14:19, Mike Walsh <englantilai...@xxxxxxxxxxx> wrote:
Post programming questions instead to the Programming newsgroup at

microsoft.public.sharepoint.development_and_programming

which is where the programming experts are.

Say there that you are using WSS 2.0 (rather than "sharepoint 2003"
which could also mean SPS 2003.

Mike Walsh
WSS FAQhttp://www.wssv3faq.com/http://wss.collutions.com
no private e-mail questions please



Berrocoso wrote:
Hello,
I'm using a .net Framework 2.0 application for upload document with
sharepoint 2003 "Put Document" method. The problem is when the
application try to upload a file with character like "á, é, í, ó, ú,
[. ]". The excepcion returns the folowing error:
Error al procesar fichero : System.Net.WebException: Se ha terminado
la conexión: La conexión ha terminado de forma inesperada.
en System.Net.HttpWebRequest.GetResponse()
en
SipaAdmElectIntegracion.SharePointFileUploader.SendRequest(String uri,
Byte[] postBody, Int64 postLength)
en
SipaAdmElectIntegracion.SharePointFileUploader.SendRequest(String uri,
String postBody)
en
SipaAdmElectIntegracion.SharePointFileUploader.UrlToWebUrl(String uri,
String& webUrl, String& fileUrl)
en
SipaAdmElectIntegracion.SharePointFileUploader.PutDocument(String uri,
Byte[] bFichero, String metaInfo)
Can someone help me??
thanks- Ocultar texto de la cita -
- Mostrar texto de la cita -

Im sorry, im from spain and my english isn't the best. and is the
first time that i write in this google group. My application is .net
framework 2.0 but i use the put document method because the sharepoint
portal is 2003. I put the files without errors. I only have errors
when the file name is with this characters. I don't know if exits any
parameters in put document method that i could use to normalize or
convert in any codification the file name. this is the code:

public void PutDocument(string uri, byte[] bFichero, string metaInfo)
{
Uri myUri = new Uri(uri);
string webUrl, fileUrl;
UrlToWebUrl(uri, out webUrl, out fileUrl);

if (null == metaInfo)
metaInfo = "";

string postBody = String.Format(
"method=put
+document&service_name=&document=[document_name={0};meta_info=[{1}]]&put_option=overwrite&comment=&keep_checked_out=false
\n",
HttpUtility.UrlEncode(fileUrl),
metaInfo);

UTF8Encoding encoding = new UTF8Encoding();
MemoryStream stream = new MemoryStream();

stream.Write(encoding.GetBytes(postBody), 0,
postBody.Length);
stream.Write(bFichero, 0, bFichero.Length);

SendRequest(myUri.GetLeftPart(UriPartial.Authority) +
webUrl + "/_vti_bin/_vti_aut/author.dll", stream.GetBuffer(),
stream.Length);
stream.Close();
}
.



Relevant Pages

  • Re: Put document and FileName
    ... sharepoint 2003 "Put Document" method. ... SipaAdmElectIntegracion.SharePointFileUploader.SendRequest(String uri, ... String& webUrl, String& fileUrl) ... public void PutDocument(string uri, bytebFichero, string metaInfo) ...
    (microsoft.public.sharepoint.windowsservices)
  • RE: MSVSTO.Applications.Runtime.IEntryPoint vs multiple verions is
    ... FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean ... at System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, ... the assembies ref to error ...
    (microsoft.public.office.developer.automation)
  • RE: Using excel to Determine if a File Exists in SharePoint
    ... sharepoint to, then right click a file in explorer view ... Sub CheckIfexists() ... MsgBox "No File!!" ... Dim sPath As String ...
    (microsoft.public.excel.programming)
  • Re: FtpWebRequest UploadFile
    ... As for using Uri class ... on using Uri or just string path. ... string in advance, using Uri class ... | Subject: Re: FtpWebRequest UploadFile ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Active Directory Web Part
    ... I'm trying to give SharePoint administrators the ability ... Directory before he is added to SharePoint). ... (String className, String relativeName) ... security settings via a Custom Policy File, ...
    (microsoft.public.sharepoint.teamservices.caml)