upload

Upload image to server using C#/.NET and storing filename in DB

♀尐吖头ヾ 提交于 2019-12-01 22:44:58
问题 I'm currently using the following snippet to insert data into a table in my database. It works great. But, I want to start adding filename data and not sure how to proceed. I have the following: // Create command comm = new SqlCommand( "INSERT INTO Entries (Title, Description) " + "VALUES (@Title, @Description)", conn); // Add command parameters comm.Parameters.Add("@Description", System.Data.SqlDbType.Text); comm.Parameters["@Description"].Value = descriptionTextBox.Text; comm.Parameters.Add

How to stop iframe loading?

独自空忆成欢 提交于 2019-12-01 22:11:18
问题 Hi I'm uploading a file through an iframe. HTML: <from action="upload.php" target="iframe"> <input type="file" name="file" /> <input type="submit" /> </form> <iframe name="iframe" src="javascript:false;"></iframe> Now I would like to abort the upload while uploading. So I would like to stop the iframe loading. What I've tried $("iframe").attr("src", "javascript:false;"); $("iframe").remove(); if (typeof(window.frames[0].stop) === "function") window.frames[0].stop(); else window.frames[0]

Retrieving progress of Direct Upload using youtube gdata API

爷,独闯天下 提交于 2019-12-01 21:59:16
问题 I'm following along with the documentation about using the gData Youtube API for doing direct uploads with PHP. I can successfully upload videos, so thats all well and good. The part I'm having trouble figuring out, if its even possible is getting some upload progress status as in percent complete or number of bytes uploaded. Here is the snippet of code where the upload happens. <?php try { $newEntry = $yt->insertEntry($myVideoEntry, $uploadUrl, 'Zend_Gdata_YouTube_VideoEntry'); } catch (Zend

Upload data method in REST web service

泪湿孤枕 提交于 2019-12-01 21:43:38
Do anyone know how can I write POST method in RESTful web service to upload data using java ? I found that smartupload and commons.upload are just for web page. You can use some JAX-RS library, like Apache Wink , so you can write something like this: @Path("/upload") class UploadResource { @POST @Consumes(MediaType.APPLICATION_OCTET_STREAM) public Response upload(byte[] input) { // store input somewhere return Response.ok().build(); } } So you will receieve your file is byte[] . You can also receive as InputStream: @Path("/upload") class UploadResource { @POST @Consumes(MediaType.APPLICATION

Upload only war/jar files in gradle(restrict zip/tar generation and upload)

会有一股神秘感。 提交于 2019-12-01 21:29:47
My build script is like as follows. I use gradle build command to build and gradle upload command to upload the artifact. My problem is a tar,zip file is also generated with this command and get uploaded. I dont want it. Only things I would like to get uploaded is 'jar' and 'war' files. I have also a related question posted by me yesterday here . More details(I have excluded some unwanted code) build file in root allprojects { apply plugin: 'maven' group = 'groupid' version = '1.0-SNAPSHOT' } subprojects { apply plugin: 'java' sourceCompatibility = 1.7 targetCompatibility = 1.7 repositories {

Get original filename google app engine

大兔子大兔子 提交于 2019-12-01 21:15:34
问题 When receiving a file upload on google app engine, the example assumes you're receiving a .png. However you only konw what the type of the image is by the extension on the filename. How do you get the original filename uploaded on GAE? 回答1: The filename of the file that is being uploaded can be determined by looking at the filename property of the variable that holds the file. For example, let's say that your form has a field named content : <input type="file" name="content" /> Inside your

Getting the Full Path Of A File Upload Field In A Form in PHP

≯℡__Kan透↙ 提交于 2019-12-01 20:57:43
I am using a file upload in PHP. I want to get the Full PATH of the File Selected. Is there any way i can get the full path in PHP?? For Eg: i uploaded a image from : "c:\upload\check.jpeg" I want the full path.. as "c:\upload\check.jpeg". i tried pathinfo, $_FILES. But no help. Thanks in advance. You probably can't. Many browsers these days don't send that information, as it can give attackers information about the user's system. On the client side fileinput.value will give just the filename in Firefox and the full path in IE8. No browser will send the full path to the server as that would be

Wordpress: An error occurred in the upload

做~自己de王妃 提交于 2019-12-01 20:39:57
问题 After updating to WordPress 3.5, I started getting the following error when uploading files using the Add Media button as a non-admin user: Error: An error occurred in the upload. Please try again later. The image seems to finish uploading, but right at the end this error message appears. This doesn't happen for the administrator, only the other roles. I've even tried giving the other role full admin capabilities, but the error still appears. Is this a bug? Or am I missing something? 回答1:

Retrieving progress of Direct Upload using youtube gdata API

◇◆丶佛笑我妖孽 提交于 2019-12-01 20:29:33
I'm following along with the documentation about using the gData Youtube API for doing direct uploads with PHP. I can successfully upload videos, so thats all well and good. The part I'm having trouble figuring out, if its even possible is getting some upload progress status as in percent complete or number of bytes uploaded. Here is the snippet of code where the upload happens. <?php try { $newEntry = $yt->insertEntry($myVideoEntry, $uploadUrl, 'Zend_Gdata_YouTube_VideoEntry'); } catch (Zend_Gdata_App_HttpException $httpException) { echo $httpException->getRawResponseBody(); } catch (Zend

How to stop iframe loading?

天涯浪子 提交于 2019-12-01 19:42:57
Hi I'm uploading a file through an iframe. HTML: <from action="upload.php" target="iframe"> <input type="file" name="file" /> <input type="submit" /> </form> <iframe name="iframe" src="javascript:false;"></iframe> Now I would like to abort the upload while uploading. So I would like to stop the iframe loading. What I've tried $("iframe").attr("src", "javascript:false;"); $("iframe").remove(); if (typeof(window.frames[0].stop) === "function") window.frames[0].stop(); else window.frames[0].document.execCommand("Stop"); All functions don't throw an error but after a while the file I've canceled