This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <style type="text/css"> | |
| .resume-upload{ | |
| width: 60%; | |
| height: 200px; | |
| background: skyblue; | |
| margin: 40 auto; | |
| border: 1px dashed black; | |
| } | |
| </style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script src="resumable.js"></script> | |
| <script> | |
| var r = new Resumable({ | |
| target:'http://localhost:8080/upload', | |
| }); | |
| r.assignBrowse(document.getElementById('upload-area')); | |
| // Resumable.js isn't supported, fall back on a different method | |
| if(!r.support) location.href = '/some-old-crappy-uploader'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ResumableUpload handles reumable uploads | |
| func ResumableUpload(w http.ResponseWriter, r *http.Request) { | |
| tempFolder := "/path/to/uploads/temp/" | |
| switch r.Method { | |
| case "GET": | |
| resumableIdentifier, _ := r.URL.Query()["resumableIdentifier"] | |
| resumableChunkNumber, _ := r.URL.Query()["resumableChunkNumber"] | |
| path := fmt.Sprintf("%s%s", tempFolder, resumableIdentifier[0]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| chunkSizeInBytes := 1048576 | |
| chunksDir := "/path/to/uploads/temp/3203610240-WildifeTactics" | |
| /* | |
| Generate an empty file | |
| */ | |
| f, err := os.Create("testfile.mp4") | |
| if err != nil { | |
| fmt.Printf("Error: %s", err) | |
| } |
OlderNewer