0

I want to upload a video file to a local server (apache over XAMPP) by using BackgrountTrasfer. I have a test folder (xampp/htdocs/test/) but get an 404 Error with "localhost/test"

I get no errors if I use just localhost but I can also find no file on the computer. Do I need special configuration of the apache or is my code bad?

private async void UploadFiles()
{
    Uri uri = new Uri("http://localhost:8080/test/");
    StorageFile videofile = await Windows.Storage.KnownFolders.VideosLibrary.GetFileAsync("vid.mp4");

    BackgroundUploader uploader = new BackgroundUploader();
    uploader.SetRequestHeader(FileName + ".mp4", videofile.Name);
    UploadOperation upload = uploader.CreateUpload(uri, videofile);

    await upload.StartAsync();
}

I see that I need a script on sever side. There is one if you download BackgroundTrasfer sample from MSDN but it is a aspx file. I need php. Any idea where to get one?

4

1 回答 1

0

模拟器作为独立于本地系统的设备运行:localhost 是模拟器本身,而不是模拟器运行的主机。

您需要设置服务器,使其在本地系统外部可见,然后使用主机系统的地址连接到它。有关详细信息,请参阅 MSDN 的如何从 Windows Phone 8 模拟器连接到本地 Web 服务。本文解释了在 IIS 上而不是在 Apache 上的设置,但即使服务器详细信息不同,一般概念也是相同的。

于 2014-12-10T20:11:17.187 回答