Skip to content

Commit

Permalink
完善多线程上传
Browse files Browse the repository at this point in the history
  • Loading branch information
Redns committed Mar 28, 2022
1 parent 74e1cbb commit 9f504a2
Show file tree
Hide file tree
Showing 42 changed files with 112 additions and 14 deletions.
Binary file modified .vs/ImageBed/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified .vs/ImageBed/v17/.futdcache.v1
Binary file not shown.
Binary file modified .vs/ImageBed/v17/.suo
Binary file not shown.
Binary file removed Data/Resources/Images/1648420501575.jpeg
Binary file not shown.
Binary file removed Data/Resources/Images/1648421260890.jpeg
Binary file not shown.
Binary file removed Data/Resources/Images/1648421607233.jpeg
Binary file not shown.
Binary file removed Data/Resources/Images/1648421762956.jpg
Binary file not shown.
Binary file removed Data/Resources/Images/1648422348458.jpeg
Binary file not shown.
Binary file removed Data/Resources/Images/1648422509441.jpeg
Binary file not shown.
Binary file removed Data/Resources/Images/1648422630167.jpg
Binary file not shown.
22 changes: 15 additions & 7 deletions Pages/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</style>

<div>
<input id="image_input" type="file" name="file" hidden accept="image/*"/>
<input id="image_input" type="file" name="file[]" hidden accept="image/*" multiple/>
</div>
<div class="upload">
<img id="upload" src="~/upload.png" width=550 style="position:center">
Expand All @@ -37,10 +37,15 @@
}
image_input.onchange = function(){
if(this.files[0]){
var form = new FormData();
form.append("", this.files[0], this.files[0].FileName);
var urls = ""
var imgList = image_input.files
if(imgList != undefined){
var form = new FormData();
for(var i = 0; i < imgList.length; i++){
form.append("", imgList[i], imgList[i].name);
}
var settings = {
"url": `${window.location.origin}/api/image`,
"method": "POST",
Expand All @@ -50,12 +55,15 @@
"contentType": false,
"data": form
};
$.ajax(settings).done(function (response) {
var response = JSON.parse(response);
if(response.statusCode == 200){
alert(`${window.location.origin}${response.res[0]}`);
copyToClip(`${window.location.origin}${response.res[0]}`);
for(var i = 0; i < response.res.length; i++){
urls += `${window.location.origin}${response.res[i]}\n`
}
alert(urls)
copyToClip(urls, "")
}
else{
alert(`上传失败,{response.message}`);
Expand Down
5 changes: 5 additions & 0 deletions Pages/Pics.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@page
@model ImageBed.Pages.PicsModel

@{
}
12 changes: 12 additions & 0 deletions Pages/Pics.cshtml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;

namespace ImageBed.Pages
{
public class PicsModel : PageModel
{
public void OnGet()
{
}
}
}
3 changes: 3 additions & 0 deletions Pages/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
</button>
<div class="navbar-collapse collapse d-sm-inline-flex justify-content-between">
<ul class="navbar-nav flex-grow-1">
<li class="nav-item">
<a class="nav-link text-dark" href="/Pics">Pictures</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" href="https://github.com/Redns/ImageBed">Github</a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion Properties/PublishProfiles/FolderProfile.pubxml.user
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<TimeStampOfAssociatedLegacyPublishXmlFile />
<_PublishTargetUrl>D:\Project\ImageBed\bin\Release\net6.0\publish\</_PublishTargetUrl>
<History>True|2022-03-27T15:10:44.5752490Z;True|2022-03-27T22:40:30.9391564+08:00;True|2022-03-27T20:15:43.7802058+08:00;True|2022-03-25T22:24:45.6590264+08:00;True|2022-03-25T22:16:56.3121054+08:00;True|2022-03-25T22:14:58.3048004+08:00;True|2022-03-25T21:57:59.6895276+08:00;True|2022-03-25T21:47:39.9886632+08:00;True|2022-03-06T20:53:13.2926466+08:00;True|2022-03-06T19:10:23.2974300+08:00;True|2022-03-06T19:07:45.3352516+08:00;True|2022-03-06T18:48:30.1587937+08:00;True|2022-03-06T18:47:48.4978613+08:00;True|2022-03-06T17:48:35.3765104+08:00;True|2022-03-06T17:45:56.4462389+08:00;True|2022-03-06T17:42:13.9819644+08:00;True|2022-03-06T17:30:03.2610584+08:00;True|2022-03-06T17:24:55.2112848+08:00;</History>
<History>True|2022-03-28T13:18:55.2348641Z;True|2022-03-27T23:10:44.5752490+08:00;True|2022-03-27T22:40:30.9391564+08:00;True|2022-03-27T20:15:43.7802058+08:00;True|2022-03-25T22:24:45.6590264+08:00;True|2022-03-25T22:16:56.3121054+08:00;True|2022-03-25T22:14:58.3048004+08:00;True|2022-03-25T21:57:59.6895276+08:00;True|2022-03-25T21:47:39.9886632+08:00;True|2022-03-06T20:53:13.2926466+08:00;True|2022-03-06T19:10:23.2974300+08:00;True|2022-03-06T19:07:45.3352516+08:00;True|2022-03-06T18:48:30.1587937+08:00;True|2022-03-06T18:47:48.4978613+08:00;True|2022-03-06T17:48:35.3765104+08:00;True|2022-03-06T17:45:56.4462389+08:00;True|2022-03-06T17:42:13.9819644+08:00;True|2022-03-06T17:30:03.2610584+08:00;True|2022-03-06T17:24:55.2112848+08:00;</History>
</PropertyGroup>
</Project>
Binary file modified bin/Debug/net6.0/ImageBed.dll
Binary file not shown.
Binary file modified bin/Debug/net6.0/ImageBed.pdb
Binary file not shown.
Binary file modified bin/Release/net6.0/ImageBed.dll
Binary file not shown.
Binary file modified bin/Release/net6.0/ImageBed.pdb
Binary file not shown.
Binary file modified bin/Release/net6.0/publish/ImageBed.dll
Binary file not shown.
Binary file modified bin/Release/net6.0/publish/ImageBed.pdb
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ build_metadata.AdditionalFiles.CssScope =
build_metadata.AdditionalFiles.TargetPath = UGFnZXNcSW5kZXguY3NodG1s
build_metadata.AdditionalFiles.CssScope =

[D:/Project/ImageBed/Pages/Pics.cshtml]
build_metadata.AdditionalFiles.TargetPath = UGFnZXNcUGljcy5jc2h0bWw=
build_metadata.AdditionalFiles.CssScope =

[D:/Project/ImageBed/Pages/Shared/_ValidationScriptsPartial.cshtml]
build_metadata.AdditionalFiles.TargetPath = UGFnZXNcU2hhcmVkXF9WYWxpZGF0aW9uU2NyaXB0c1BhcnRpYWwuY3NodG1s
build_metadata.AdditionalFiles.CssScope =
Expand Down
Binary file modified obj/Debug/net6.0/ImageBed.csproj.AssemblyReference.cache
Binary file not shown.
2 changes: 1 addition & 1 deletion obj/Debug/net6.0/ImageBed.csproj.CoreCompileInputs.cache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4ccd8c8281e3b1d499d1eb9ddf12a23d5143e055
f21de36e93df37289abc3ffca33198c02a737c96
6 changes: 3 additions & 3 deletions obj/Debug/net6.0/ImageBed.csproj.FileListAbsolute.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
D:\Project\ImageBed\bin\Debug\net6.0\appsettings.Development.json
D:\Project\ImageBed\bin\Debug\net6.0\appsettings.json
D:\Project\ImageBed\bin\Debug\net6.0\libman.json
D:\Project\ImageBed\bin\Debug\net6.0\ImageBed.staticwebassets.runtime.json
D:\Project\ImageBed\bin\Debug\net6.0\ImageBed.exe
D:\Project\ImageBed\bin\Debug\net6.0\ImageBed.deps.json
D:\Project\ImageBed\bin\Debug\net6.0\ImageBed.runtimeconfig.json
D:\Project\ImageBed\bin\Debug\net6.0\ImageBed.dll
D:\Project\ImageBed\bin\Debug\net6.0\ImageBed.pdb
D:\Project\ImageBed\bin\Debug\net6.0\Newtonsoft.Json.dll
D:\Project\ImageBed\obj\Debug\net6.0\ImageBed.csproj.AssemblyReference.cache
D:\Project\ImageBed\obj\Debug\net6.0\ImageBed.GeneratedMSBuildEditorConfig.editorconfig
D:\Project\ImageBed\obj\Debug\net6.0\ImageBed.AssemblyInfoInputs.cache
Expand All @@ -19,11 +21,9 @@ D:\Project\ImageBed\obj\Debug\net6.0\staticwebassets.development.json
D:\Project\ImageBed\obj\Debug\net6.0\scopedcss\Pages\Shared\_Layout.cshtml.rz.scp.css
D:\Project\ImageBed\obj\Debug\net6.0\scopedcss\bundle\ImageBed.styles.css
D:\Project\ImageBed\obj\Debug\net6.0\scopedcss\projectbundle\ImageBed.bundle.scp.css
D:\Project\ImageBed\obj\Debug\net6.0\ImageBed.csproj.CopyComplete
D:\Project\ImageBed\obj\Debug\net6.0\ImageBed.dll
D:\Project\ImageBed\obj\Debug\net6.0\refint\ImageBed.dll
D:\Project\ImageBed\obj\Debug\net6.0\ImageBed.pdb
D:\Project\ImageBed\obj\Debug\net6.0\ImageBed.genruntimeconfig.cache
D:\Project\ImageBed\obj\Debug\net6.0\ref\ImageBed.dll
D:\Project\ImageBed\bin\Debug\net6.0\Newtonsoft.Json.dll
D:\Project\ImageBed\obj\Debug\net6.0\ImageBed.csproj.CopyComplete
D:\Project\ImageBed\bin\Debug\net6.0\libman.json
Binary file modified obj/Debug/net6.0/ImageBed.dll
Binary file not shown.
Binary file modified obj/Debug/net6.0/ImageBed.pdb
Binary file not shown.
2 changes: 1 addition & 1 deletion obj/Debug/net6.0/project.razor.json

Large diffs are not rendered by default.

Binary file modified obj/Debug/net6.0/ref/ImageBed.dll
Binary file not shown.
Binary file modified obj/Debug/net6.0/refint/ImageBed.dll
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ build_metadata.AdditionalFiles.CssScope =
build_metadata.AdditionalFiles.TargetPath = UGFnZXNcSW5kZXguY3NodG1s
build_metadata.AdditionalFiles.CssScope =

[D:/Project/ImageBed/Pages/Pics.cshtml]
build_metadata.AdditionalFiles.TargetPath = UGFnZXNcUGljcy5jc2h0bWw=
build_metadata.AdditionalFiles.CssScope =

[D:/Project/ImageBed/Pages/Shared/_ValidationScriptsPartial.cshtml]
build_metadata.AdditionalFiles.TargetPath = UGFnZXNcU2hhcmVkXF9WYWxpZGF0aW9uU2NyaXB0c1BhcnRpYWwuY3NodG1s
build_metadata.AdditionalFiles.CssScope =
Expand Down
2 changes: 1 addition & 1 deletion obj/Release/net6.0/ImageBed.csproj.CoreCompileInputs.cache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
729fb9a2844d2638772acb6208b65f2d87079355
50329f370b9a2e61957197a53f8506a00eec3930
Binary file modified obj/Release/net6.0/ImageBed.dll
Binary file not shown.
Binary file modified obj/Release/net6.0/ImageBed.pdb
Binary file not shown.
Binary file modified obj/Release/net6.0/PubTmp/Out/ImageBed.dll
Binary file not shown.
Binary file modified obj/Release/net6.0/PubTmp/Out/ImageBed.pdb
Binary file not shown.
Binary file modified obj/Release/net6.0/ref/ImageBed.dll
Binary file not shown.
Binary file modified obj/Release/net6.0/refint/ImageBed.dll
Binary file not shown.
62 changes: 62 additions & 0 deletions obj/staticwebassets.pack.sentinel
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,65 @@
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0

0 comments on commit 9f504a2

Please sign in to comment.