2017-10-16 4 views
0

업 로더의 이메일 및 이름과 함께 동영상 파일을 내 보관함 또는 Google 드라이브에 업로드하려면이 코드를 내 블로거 페이지에 삽입하십시오. 나는 다음 코드를 사용하고 있지만 파일을 올리면 업로드 할 사용자의 Google 드라이브 또는 보관 용 계정 (및 폴더)을 지정하는 방법을 모르며 업 로더 (이름 및 전자 메일)이 비디오 파일과 함께 업로드됩니다. 나는 웹 호스팅 공간을 살 여유가 없기 때문에 블로거, dropbox 또는 내 Google 드라이브 (모든 무료 서비스)를 사용하여 이것을 수행해야합니다. 미리 감사드립니다. 너 락!파일을 이름 및 이메일과 함께 드롭 박스 또는 Google 드라이브에 업로드하는 HTML 코드?

<div dir="ltr" style="text-align: left;" trbidi="on"> 
<!-- Paste this into forms.html --> 

<!-- Text input fields --> 
<input id="name" placeholder="Your Name" type="text" /> 
<input id="email" placeholder="Your Email" type="email" /> 
<!-- File upload button --> 
<input id="file" type="file" /> 
<!-- Form submit button --> 
<button onclick="submit(); return false;">Submit</button> 
<!-- Show Progress --> 
<br /> 
<div id="progress"> 
</div> 
<!-- Add the jQuery library --> 
<script src="https://code.jquery.com/jquery.min.js"></script> 

<script> 

    var file, 
    reader = new FileReader(); 

    // Upload the file to Google Drive 
    reader.onloadend = function(e) { 
    google.script.run 
    .withSuccessHandler(showMessage) 
    .uploadFileToGoogleDrive(
    e.target.result, file.name, 
    $('input#name').val(), 
    $('input#email').val() 
); 
}; 

// Read the file on form submit 
function submitForm() { 
file = $('#file')[0].files[0]; 
showMessage("Uploading file.."); 
reader.readAsDataURL(file); 
} 

function showMessage(e) { 
$('#progress').html(e);} 

</script></div> 

답변

0

시크릿 양식을 사용할 수 있습니다. 무료 파일 용으로 100MB를 제공합니다.

관련 문제