Cevaplar
-
paylaşacağın klasöre yazma izni vermelisin :) Haa birde dosyayı yüklemen gerek :D
-
webadmin
?? anlamadım?4 ay önce yazılmış
-
-
asp.net icin kullandıgınız ozel bir component varmı mesela aspupload compenentii gibi ona gore cevap yazıcam.
-
siyahbeyaz
Dim DosyaTipi As String = dosya.PostedFile.ContentType
If DosyaTipi = "text/plain" Or DosyaTipi = "application/msword" Then
/* upload islemleri.... */
else
response.write "Sadece Doc ve txt uzantıları yukleyebilirsiniz..";
end if4 ay önce yazılmış -
siyahbeyaz
docx uzantılı dosylardada hata verebilir. bunun ıcın mimetype lerini veriyorum.. uygun görürsen ekleme yaparsın
.xlsx application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
.xltx application/vnd.openxmlformats-officedocument.spreadsheetml.template
.potx application/vnd.openxmlformats-officedocument.presentationml.template
.ppsx application/vnd.openxmlformats-officedocument.presentationml.slideshow
.pptx application/vnd.openxmlformats-officedocument.presentationml.presentation
.sldx application/vnd.openxmlformats-officedocument.presentationml.slide
.docx application/vnd.openxmlformats-officedocument.wordprocessingml.document
.dotx application/vnd.openxmlformats-officedocument.wordprocessingml.template
.xlam application/vnd.ms-excel.addin.macroEnabled.12
.xlsb application/vnd.ms-excel.sheet.binary.macroEnabled.124 ay önce yazılmış -
webadmin
string Path = null;
if (FlResim.HasFile)
{
string[] fileNameNew = FlResim.FileName.Split('.');
fileNameNew[0] += System.Guid.NewGuid().ToString().Replace("=", "").Replace("-", "").Replace("+", "");
Path = "~/dosya/" + fileNameNew[0].ToString() + "." + fileNameNew[1].ToString();
FlResim.SaveAs(Server.MapPath(Path));
// Label1.Text = "oldu";
} böle ypıorum. file upload nesnesi kullanıorum4 ay önce yazılmış
-
-
string uzanti=System.IO.Path.GetExtension(FileUpload1.fileNmae);
if (uzanti==".txt" || uzanti==".doc")
{
//işlemini burada ya
}else
{
response.write("sadece txt ve doc uzantılı dosyaları paylaşabilirsiniz.");
}


