Click here to Skip to main content
15,912,329 members
Home / Discussions / C#
   

C#

 
AnswerRe: UWP / VisualStudio 2017 and StackOverflowException Pin
BillWoodruff27-Apr-18 18:45
professionalBillWoodruff27-Apr-18 18:45 
GeneralRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Super Lloyd27-Apr-18 23:49
Super Lloyd27-Apr-18 23:49 
AnswerRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Eddy Vluggen28-Apr-18 0:01
professionalEddy Vluggen28-Apr-18 0:01 
GeneralRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Super Lloyd28-Apr-18 0:41
Super Lloyd28-Apr-18 0:41 
SuggestionRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Eddy Vluggen28-Apr-18 1:07
professionalEddy Vluggen28-Apr-18 1:07 
GeneralRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Richard MacCutchan28-Apr-18 1:48
mveRichard MacCutchan28-Apr-18 1:48 
GeneralRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Eddy Vluggen28-Apr-18 1:51
professionalEddy Vluggen28-Apr-18 1:51 
GeneralRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Super Lloyd28-Apr-18 4:48
Super Lloyd28-Apr-18 4:48 
GeneralRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Eddy Vluggen28-Apr-18 4:59
professionalEddy Vluggen28-Apr-18 4:59 
GeneralRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Super Lloyd28-Apr-18 5:47
Super Lloyd28-Apr-18 5:47 
GeneralRe: UWP / VisualStudio 2017 and StackOverflowException Pin
BillWoodruff28-Apr-18 4:55
professionalBillWoodruff28-Apr-18 4:55 
JokeRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Eddy Vluggen28-Apr-18 5:01
professionalEddy Vluggen28-Apr-18 5:01 
GeneralRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Super Lloyd28-Apr-18 5:45
Super Lloyd28-Apr-18 5:45 
AnswerRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Super Lloyd28-Apr-18 5:38
Super Lloyd28-Apr-18 5:38 
GeneralRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Eddy Vluggen28-Apr-18 6:14
professionalEddy Vluggen28-Apr-18 6:14 
GeneralRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Super Lloyd28-Apr-18 15:56
Super Lloyd28-Apr-18 15:56 
GeneralRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Eddy Vluggen29-Apr-18 0:29
professionalEddy Vluggen29-Apr-18 0:29 
QuestionSend data to remote server using TCPClient Pin
Carmen_Mundi26-Apr-18 8:07
Carmen_Mundi26-Apr-18 8:07 
AnswerRe: Send data to remote server using TCPClient Pin
Richard Deeming26-Apr-18 8:21
mveRichard Deeming26-Apr-18 8:21 
GeneralRe: Send data to remote server using TCPClient Pin
Carmen_Mundi26-Apr-18 8:55
Carmen_Mundi26-Apr-18 8:55 
GeneralRe: Send data to remote server using TCPClient Pin
Gerry Schmitz26-Apr-18 10:25
mveGerry Schmitz26-Apr-18 10:25 
QuestionCould not find a part of the path c# in Internet explorer Pin
Member 1204569226-Apr-18 1:29
Member 1204569226-Apr-18 1:29 
I have a webpage that Is hosted on a IIS-server. When I use Internet explorer to upload files, I get the following error:

<System.Exception: System.Exception: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\brkar1\Downloads\dokumentation.docx'. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)<br />
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)<br />
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)<br />
at System.IO.File.InternalWriteAllBytes(String path, Byte[] bytes, Boolean checkHost) at System.IO.File.WriteAllBytes(String path, Byte[] bytes) at OrderForm.Service.Services.FileService.d__0.MoveNext() in C:\Git-new\devteam\web-applications\ICOM.OrderForm\OrderForm.Service\Services\F


However, If I use firefox, It works just fine.

If I start the project localy in IIS-express, I don't get any exception, but the file Is still not uploaded.

Here Is my code for uploading:

OrderController.cs:
C#
var keys = Request.Form.AllKeys;
            var jsonData = Request.Form.Get(keys[0]);
            var files = this.Request.Files;
        List<FileModel> fileData = new List<FileModel>();
        if (files.Count > 0)
        {
            for (var i = 0; i < files.Count; i++)
            {
                FileModel fileModel = new FileModel();
                HttpPostedFileBase file = files[i];
                BinaryReader b = new BinaryReader(file.InputStream);
                fileModel.data = b.ReadBytes(file.ContentLength);
                fileModel.FileName = file.FileName;

                fileData.Add(fileModel);
            }

        }
var result = await orderService.Create(orderModel, fileData.Count() > 0 ? fileData : null);


Orderservice:
C#
if (files.Count() > 0 && orderNo > 0)
                {
                    var folder = ConfigurationManager.AppSettings["AttachmentFolder"] + "\\" + orderNo;

                    if (Directory.Exists(folder) == false)
                    {
                        Directory.CreateDirectory(folder);
                    }

                    foreach (var file in files)
                    {
                        FileModel newFile = new FileModel();
                        var fileName = file.FileName;
                        var filePath = Path.Combine(folder, fileName);
                        File.WriteAllBytes(filePath, file.data); //This seem to not work when using Internet Explorer

                        newFile.FileName = fileName;
                        newFile.FileUrl = filePath;
                        filesWithPath.Add(newFile);
                    }

                    return filesWithPath;
                }


ConfigurationManager.AppSettings["AttachmentFolder"] + "\\" + orderNo is just a folder where the file should be saved In.
AnswerRe: Could not find a part of the path c# in Internet explorer Pin
Richard Deeming26-Apr-18 3:14
mveRichard Deeming26-Apr-18 3:14 
Questiondisabling a textbox at intialization in wpf/C# Pin
jhoga25-Apr-18 4:27
jhoga25-Apr-18 4:27 
AnswerRe: disabling a textbox at intialization in wpf/C# Pin
Richard MacCutchan25-Apr-18 5:04
mveRichard MacCutchan25-Apr-18 5:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.