如何在移动web上上传文件
1个回答
展开全部
webservice怎么处理移动端的文件上传
代码如下:
static public ArrayOfBase64Binary SendFile(string[] fPaths)
{
FileStream fStream;
ArrayOfBase64Binary lstB = new ArrayOfBase64Binary();
int fCount = fPaths.Length;
if (fCount != 0)
{
for (int i = 0; i < fCount; i++)
{
fStream = new FileStream(fPaths[i], FileMode.Open, FileAccess.Read);
Byte[] b = new Byte[fStream.Length];
fStream.Read(b, 0, b.Length);
lstB.Add(b);
fStream.Flush();
fStream.Close();
}
}
return lstB;
static public void AcceptFile(List<Byte[]> lstB)
{
for (int i = 0; i < lstB.Count; i++)
{
string path = "C:\\Down\\" + i + ".jpg";
FileStream fStream = new FileStream(path, FileMode.Create, FileAccess.Write);
fStream.Write(lstB[i], 0, lstB[i].Length);
fStream.Close();
}
}
代码如下:
static public ArrayOfBase64Binary SendFile(string[] fPaths)
{
FileStream fStream;
ArrayOfBase64Binary lstB = new ArrayOfBase64Binary();
int fCount = fPaths.Length;
if (fCount != 0)
{
for (int i = 0; i < fCount; i++)
{
fStream = new FileStream(fPaths[i], FileMode.Open, FileAccess.Read);
Byte[] b = new Byte[fStream.Length];
fStream.Read(b, 0, b.Length);
lstB.Add(b);
fStream.Flush();
fStream.Close();
}
}
return lstB;
static public void AcceptFile(List<Byte[]> lstB)
{
for (int i = 0; i < lstB.Count; i++)
{
string path = "C:\\Down\\" + i + ".jpg";
FileStream fStream = new FileStream(path, FileMode.Create, FileAccess.Write);
fStream.Write(lstB[i], 0, lstB[i].Length);
fStream.Close();
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询