Is your GP service configured to allow uploads?
If you are using API 3.x then you can upload files with a standard request:
esri.request({
url: "http://<server>/arcgis/rest/services/GP_Services/<gservice>/GPServer/uploads/upload",
form: dojo.byId("uploadForm"), // dom element
content: { f: "pjson" },
handleAs: "json",
load: uploadSuccess, // callback
error: uploadFailed // on error
});
HTML upload form:
<form enctype="multipart/form-data" method="post" id="uploadForm">
<div class="field">
<label class="file-upload">
<span><strong>Add File</strong></span>
<input type="file" name="file" id="inFile" />
</label>
</div>
</form>