Search Results

Search found 1018 results on 41 pages for 'attachment'.

Page 15/41 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Hyperlinks to download files without stopping the current page load

    - by Evgeny
    I've got an ASP.NET page that takes a long time to download and returns partial results as it's loading (as per my previous question). On the page I have some links to download files, ie. the response headers contain "Content-Disposition: attachment", so that the browser doesn't navigate away from the page. However, if the user clicks one of these links while the page is still loading it stops loading - normal behaviour, but not what I want in this case. I can get around that by adding target=_"blank" to the links, but this momentarily opens a new window and the closes it again (once the browser realises it's an "attachment"). Is there any way to avoid having those links stop the current page load without this new window trick? JavaScript is OK.

    Read the article

  • Publish to Facebook Stream in as3

    - by Kid Adiran
    Hi, I am trying to publish to a users stream when they click a share button in my flash app that i have living in a tab on a fan fan. I basically have my swf embedded on a page that has a java script function that calls the facebook share dialogue. Here is what i got so far: // flash embedd <fb:fbjs-bridge/> // share function <script> function publishfeed() { var attachment = {'media':[{'type':'image','src':'http://bit.ly/AJTnf','href':'http://bit.ly/hifZk'}]}; Facebook.streamPublish('', attachment); } In my flash file, I try using this code to get it to pull the javascript funtion, but no luck. function jspopupWindow(event:MouseEvent):void { var request:URLRequest = new URLRequest("javascript:publishfeed()"); navigateToURL(request,"_blank"); } share_btn.addEventListener(MouseEvent.CLICK, jspopupWindow); Can anyone help me, what am i missing? thanks a

    Read the article

  • How to select the first element of a set with JSTL?

    - by Sergio del Amo
    I managed to do it with the next code but there must be an easier way. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> <c:if test="${fn:length(attachments) > 0}"> <c:forEach var="attachment" items="${attachments}" varStatus="loopCount"> <c:if test="${loopCount.count eq 1}"> attachment.id </c:if> </c:forEach> </c:if>

    Read the article

  • iphone/ipad application - taking screen shot

    - by satyam
    I successfully implemented an application that works on ipad as well as on iphone. In that I provided option to user to send the screen shot of the application as mail attachment. Even that is functioning well. But my code is taking screen shot irrespective of orientation. The image i'm getting is always in portrait mode. I want to take the screen shot depending on the orientation of ipad/iphone and send the image as attachment. I'm using following code to take the screen shot. UIGraphicsBeginImageContext(screenWindow.frame.size); [screenWindow.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *screenshot = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext();

    Read the article

  • Is it possible to combine these 3 mySQL queries?

    - by Greenie
    I know the $downloadfile - and I want the $user_id. By trial and error I found that this does what I want. But it's 3 separate queries and 3 while loops. I have a feeling there is a better way. And yes, I only have a very little idea about what I'm doing :) $result = pod_query("SELECT ID FROM wp_posts WHERE guid LIKE '%/$downloadfile'"); while ($row = mysql_fetch_assoc($result)) { $attachment = $row['ID']; } $result = pod_query("SELECT pod_id FROM wp_pods_rel WHERE tbl_row_id = '$attachment'"); while ($row = mysql_fetch_assoc($result)) { $pod_id = $row['pod_id']; } $result = pod_query("SELECT tbl_row_id FROM wp_pods_rel WHERE tbl_row_id = '$pod_id' AND field_id = '28'"); while ($row = mysql_fetch_assoc($result)) { $user_id = $row['pod_id']; }

    Read the article

  • I'm using the correct content type & Headers so Why is FireFox saving Zip Files without extensions

    - by The_AlienCoder
    Users on my site have the option to download all the photos in an album as a zip file.The Zip file is dynamically created and saved to Response.OutPutStream to be detected as a file download on the user's browser. Here is the Header and Content-type I am outputing context.Response.AddHeader("Content-Disposition", "attachment; filename=Photos.zip"); context.Response.ContentType = "application/x-zip-compressed"; ..Well everything works fine with every browser except FireFox. Although Firefox correctly detects the download as a Zip file, It saves the file without the .zip extension. I thought adding this header context.Response.AddHeader("Content-Disposition", "attachment; filename=Photos.zip"); ..is supposed to force FF to save the extension. I believe I am following the correct protocol so why is FF behaving this way and how do I fix this?

    Read the article

  • Calculate proportional width of object (proportion: 1600x1080)

    - by Hans Stauden
    Hello, this jquery question: when I set a specific height to a "#div", i want to set the width of a inner object automatically too (cause i need a width to read it out) [ "#div" ["object"] ] example: (object).css(width: [ CALCULATION ], height: ($("#div").height())+'px' ) the original proportion of the image is: 1600x1080 here's the link to the attachment, take a look at it (tinypic): link text the heights "500px", "600px" and "700px" you can see in the attachment are just examples, the heigth could also be "711px", "623px", "998px" etc. cause the "#div" scales with the browser (i can read out the height of window, that works) my math skills aren't really good, would be great if someone could help me out :-)

    Read the article

  • How to generate a PDF from a view using media=print for styles

    - by Riderman de Sousa Barbosa
    Most of the questions in stackoverflow or in other forums, show how to generate views and sends them by email. But my goal is to generate a PDF from a view with the media=print format and sends it in attachment by email. I have a view that displays a report. I use CSS Print to display this report in a print format. (Basically I display some elements and hide others). How can I generate a PDF from this view (with format media=print) and send it by e-mail in attachment. I am using ActionMailer to send emails and iTextSharp to generate PDFs

    Read the article

  • Uploading files to varbinary(max) in SQL Server -- works on one server, not the other

    - by pjabbott
    I have some code that allows users to upload file attachments into a varbinary(max) column in SQL Server from their web browser. It has been working perfectly fine for almost two years, but all of a sudden it stopped working. And it stopped working on only the production database server -- it still works fine on the development server. I can only conclude that the code is fine and there is something up with the instance of SQL Server itself. But I have no idea how to isolate the problem. I insert a record into the ATTACHMENT table, only inserting non-binary data like the title and the content type, and then chunk-upload the uploaded file using the following code: // get the file stream System.IO.Stream fileStream = postedFile.InputStream; // make an upload buffer byte[] fileBuffer; fileBuffer = new byte[1024]; // make an update command SqlCommand fileUpdateCommand = new SqlCommand("update ATTACHMENT set ATTACHMENT_DATA.WRITE(@Data, NULL, NULL) where ATTACHMENT_ID = @ATTACHMENT_ID", sqlConnection, sqlTransaction); fileUpdateCommand.Parameters.Add("@Data", SqlDbType.Binary); fileUpdateCommand.Parameters.AddWithValue("@ATTACHMENT_ID", newId); while (fileStream.Read(fileBuffer, 0, fileBuffer.Length) > 0) { fileUpdateCommand.Parameters["@Data"].Value = fileBuffer; fileUpdateCommand.ExecuteNonQuery(); <------ FAILS HERE } fileUpdateCommand.Dispose(); fileStream.Close(); Where it says "FAILS HERE", it sits for a while and then I get a SQL Server timeout error on the very first iteration through the loop. If I connect to the development database instead, everything works fine (it runs through the loop many, many times and the commit is successful). Both servers are identical (SQL Server 9.0.3042) and the schemas are identical as well. When I open Activity Monitor right after the timeout to see what's going it, it says the last command is (@Data binary(1024),@ATTACHMENT_ID decimal(4,0))update ATTACHMENT set ATTACHMENT_DATA.WRITE(@Data, NULL, NULL) where ATTACHMENT_ID = @ATTACHMENT_ID which I would expect but it also says it has a status of "Suspended" and a wait type of "PAGEIOLATCH_SH". I looked this up and it seems to be a bad thing but I can't find anything specific to my stuation. Ideas?

    Read the article

  • Converting old Mailer to Rails 3 (multipart/mixed)

    - by Oscar Del Ben
    I'm having some difficulties converting this old mailer api to rails 3: content_type "multipart/mixed" part :content_type => "multipart/alternative" do |alt| alt.part "text/plain" do |p| p.body = render_message("summary_report.text.plain.erb", :message = message.gsub(/<.br./,"\n"), :campaign=campaign, :aggregate=aggregate, :promo_messages=campaign.participating_promo_msgs) end alt.part "text/html" do |p| p.body = render_message("summary_report.text.html.erb", :message = message, :campaign=campaign, :aggregate=aggregate,:promo_messages=campaign.participating_promo_msgs) end end if bounce_path attachment :content_type => "text/csv", :body=> File.read(bounce_path), :filename => "rmo_bounced_emails.csv" end attachment :content_type => "application/pdf", :body => File.read(report_path), :filename=>"rmo_report.pdf" In particular I don't understand how to differentiate the different multipart options. Any idea?

    Read the article

  • Question about Paperclip for Rails

    - by sev
    I'm using Papeclip(2.3.1.1) with Rails(2.3.5). In my view I write so: <%= link_to image_tag(p.attachment.url(:small)), p.attachment.url(:original) %, and it becomes into href="/system/attachments/1/original/1.JPG?1270134617 (for a tag) src="/system/attachments/1/small/1.JPG?1270134617" (for img tag). And when I click on the picture, my browser (Firefox) offers me to save or open picture and I want to just open picture in browser without any dialogs. I think it's because link contains ?1270134617 after file's name. How can I fix it?

    Read the article

  • Fetch image from folder via datatable does not work after placing image in subdirectory

    - by Arnold Bishkoff
    I am having trouble wrapping my head around the following I have code that fetches an image via smarty in a line img src="getsnap.php?picid={$data[$smarty.section.sec.index].picno|default:$nextpic}&typ=pic&width={$config.disp_snap_width}&height={$config.disp_snap_height}" class="smallpic" alt="" / this works if i pull the image from /temp/userimages/userid/imageNo.ext but because an OS can segfault if you store too many folders or images in a directory i have code that assigns the user image to a subdirectory based upon division of a subdir per 1000 userids. so in thise case i have user id 94 whos images get stored in /siteroot/temp/userimages/000000/94/pic_1.jpg (through 10) or tn_1 (through 10).jpg here is the code for getsnap.php <?php ob_start(); if ( !defined( 'SMARTY_DIR' ) ) { include_once( 'init.php' ); } include('core/snaps_functions.php'); if (isset($_REQUEST['username']) && $_REQUEST['username'] != '') { $userid = $osDB-getOne('select id from ! where username = ?',array(USER_TABLE, $_REQUEST['username']) ); } else { // include ( 'sessioninc.php' ); if( !isset($_GET['id']) || (isset($_GET['id'])&& (int)$_GET['id'] <= 0 ) ) { $userid = $_SESSION['UserId']; } else { $userid = $_GET['id']; } } if (!isset($_GET['picid']) ) { if ((isset($_REQUEST['type']) && $_REQUEST['type'] != 'gallery') || !isset($_REQUEST['type']) ) { $defpic = $osDB-getOne('select picno from ! where userid = ? and ( album_id is null or album_id = ?) and default_pic = ? and active = ? ',array(USER_SNAP_TABLE, $userid,'0','Y','Y' ) ); if ($defpic != '') { $picid = $defpic; } else { $picid = $osDB-getOne('select picno from ! where userid = ? and ( album_id is null or album_id = ?) and active=? order by rand()',array(USER_SNAP_TABLE, $userid,'0','Y' ) ); } unset( $defpic); } } else { $picid = $_GET['picid']; } $typ = isset( $_GET['typ'])?$_GET['typ']:'pic' ; $cond = ''; if ( ($config['snaps_require_approval'] == 'Y' || $config['snaps_require_approval'] == '1') && $userid != $_SESSION['UserId'] ) { $cond = " and active = 'Y' "; } $sql = 'select * from ! where userid = ? and picno = ? '.$cond; //Get the pic $row =& $osDB-getRow ( $sql, array( USER_SNAP_TABLE, $userid, $picid ) ); //Okay pic was found in the DB, Lets actually do something // $id = $userid; $dir = str_pad(($id - ($id % 1000))/100000,6,'0',STR_PAD_LEFT); $zimg = USER_IMAGES_DIR.$dir; $img = getPicture($zimg, $userid, $picid, $typ, $row); //$img = getPicture($userid, $picid, $typ, $row); //$img = getPicture($dir, $userid, $picid, $typ, $row); $ext = ($typ = 'tn')?$row['tnext']:$row['picext']; // Now pic is built as // something pic_x.ext ie pic_2.jpg if ( $img != '' && ( ( hasRight('seepictureprofile') && ( $config['snaps_require_approval'] == 'Y' && $row['active'] == 'Y' ) ||$config['snaps_require_approval'] == 'N' ) || $userid == $_SESSION['UserId'] ) ) { $img2 = $img; //$img2 = $dir.'/'.$img; } else { $gender = $osDB-getOne( 'select gender from ! where id = ?', array( USER_TABLE, $userid ) ) ; if ($gender == 'M') { $nopic = SKIN_IMAGES_DIR.'male.jpg'; } elseif ($gender == 'F') { $nopic = SKIN_IMAGES_DIR.'female.jpg'; } elseif ($gender == 'D') { $nopic = SKIN_IMAGES_DIR.'director.jpg'; } $img2 = imagecreatefromjpeg($nopic); $ext = 'jpg'; } ob_end_clean(); header("Pragma: public"); header("Content-Type: image/".$ext); header("Content-Transfer-Encoding: binary"); header("Cache-Control: must-revalidate"); $ExpStr = "Expires: " . gmdate("D, d M Y H:i:s", time() - 30) . " GMT"; header($ExpStr); $id = $userid; $dir = str_pad(($id - ($id % 1000))/100000,6,'0',STR_PAD_LEFT); $zimg = USER_IMAGES_DIR.$dir; //header("Content-Disposition: attachment; filename=profile_".$userid."_".$typ.".".$ext); //header("Content-Disposition: attachment; filename=$dir.'/'.profile_".$userid."".$typ.".".$ext); //header("Content-Disposition: attachment; filename=profile"$dir".'/'.".$userid."_".$typ.".".$ext); header("Content-Disposition: attachment; filename=profile_".$userid."_".$typ.".".$ext); /* if ($_SESSION['browser'] != 'MSIE') { header("Content-Disposition: inline" ); } */ if ($ext == 'jpg') { imagejpeg($img2); } elseif ($ext == 'gif') { imagegif($img2); } elseif ($ext == 'png') { imagepng($img2); } elseif ($ext == 'bmp') { imagewbmp($img2); } imagedestroy($img2); ?

    Read the article

  • Downloading a csv file in django

    - by spyder
    I am trying to download a CSV file using HttpResponse to make sure that the browser treats it as an attachment. I follow the instructions provided here but my browser does not prompt a "Save As" dialog. I cannot figure out what is wrong with my function. All help is appreciated. dev savefile(request): try: myfile = request.GET['filename'] filepath = settings.MEDIA_ROOT + 'results/' destpath = os.path.join(filepath, myfile) response = HttpResponse(FileWrapper(file(destpath)), mimetype='text/csv' ) response['Content-Disposition'] = 'attachment; filename="%s"' %(myfile) return response except Exception, err: errmsg = "%s"%(err) return HttpResponse(errmsg) Happy Pat's day!

    Read the article

  • How do I post dynamic information to Facebook from Flash?

    - by daidai
    I am building a Flash site and I want to be able to allow the user to post dynamically produced information to their Facebook wall, but I can't find out any information within the Facebook developers documentation. Its simple enough in Javascript/HTML: <script type="text/javascript"> function callPublish(msg, attachment, action_link) { FB.ensureInit(function () { FB.Connect.streamPublish('', attachment, action_link); }); } </script> <input type="button" onclick="callPublish('',{'name':'Post this to Facebook','href':'http://dev2.com','description':'this is some body test'},null);return false;" value="Preview Dialog" /> As you can see I don't want to create sessions or login or anything complicated, just post to info to their wall.

    Read the article

  • Ruby on Rails: restrict file type with Paperclip using a flash uploader

    - by aperture
    I have a pretty basic Paperclip Upload model that is attached to a User model through has_many, and am using Uploadify to do the actual uploading. Flash sends all files with the content type of "application/octet-stream" so using validates_attachment_content_type rejects all files. In my create action, I am able to get the mime-type from the original file name, but only after it's been saved, with: def coerce(params) h = Hash.new h[:upload] = Hash.new h[:upload][:attachment].content_type = MIME::Types.type_for(h[:upload][:attachment].original_filename).to_s ... end and def create diff_params = coerce(params) @upload = Upload.new(diff_params[:upload]) ... end What would be the best way of white listing file types? I am thinking a before_validation method, but I'm not sure how that would work. Any ideas would be welcome.

    Read the article

  • JSP: I am doing an application in which i have to download ppt file .

    - by Sanjeev
    I am doing an application in which i have to download ppt file using a jsp page. I am using The following code but its not working <% try { String filename = "file/abc.ppt"; // set the http content type to "APPLICATION/OCTET-STREAM response.setContentType("APPLICATION/OCTET-STREAM"); // initialize the http content-disposition header to // indicate a file attachment with the default filename // "myFile.txt" String disHeader = "Attachment Filename=\"abc.ppt\""; response.setHeader("Content-Disposition", disHeader); // transfer the file byte-by-byte to the response object File fileToDownload = new File(filename); FileInputStream fileInputStream = new FileInputStream(fileToDownload); int i; while ((i=fileInputStream.read())!=-1) { out.write(i); } fileInputStream.close(); out.close(); }catch(Exception e) // file IO errors { e.printStackTrace(); } % can anybody solve this problem...........

    Read the article

  • Jquery remove class from image

    - by user1269625
    Hey ya'll I have these 3 images thumbnails here... <div class="wpcart_gallery" style="text-align:center; padding-top:5px;"> <a class="thickbox cboxElement" title="DSC_0118" href="http://www.taranmarlowjewelry.com/wp-content/uploads/2012/07/DSC_0118.jpg" rel="Teardrop Druzy Amethyst Ring" rev="http://www.taranmarlowjewelry.com/wp-content/uploads/2012/07/DSC_0118.jpg"> <img class="attachment-gold-thumbnails colorbox-736" width="50" height="50" title="DSC_0118" alt="DSC_0118" src="http://www.taranmarlowjewelry.com/wp-content/uploads/2012/07/DSC_0118-50x50.jpg"> </a> <a class="thickbox cboxElement" title="P7230376" href="http://www.taranmarlowjewelry.com/wp-content/uploads/2012/07/P7230376.jpg" rel="Teardrop Druzy Amethyst Ring" rev="http://www.taranmarlowjewelry.com/wp-content/uploads/2012/07/P7230376.jpg"> <img class="attachment-gold-thumbnails colorbox-736" width="50" height="50" title="P7230376" alt="P7230376" src="http://www.taranmarlowjewelry.com/wp-content/uploads/2012/07/P7230376-50x50.jpg"> </a> <a class="thickbox cboxElement" title="P7230378" href="http://www.taranmarlowjewelry.com/wp-content/uploads/2012/07/P7230378.jpg" rel="Teardrop Druzy Amethyst Ring" rev="http://www.taranmarlowjewelry.com/wp-content/uploads/2012/07/P7230378.jpg"> <img class="attachment-gold-thumbnails colorbox-736" width="50" height="50" title="P7230378" alt="P7230378" src="http://www.taranmarlowjewelry.com/wp-content/uploads/2012/07/P7230378-50x50.jpg"> </a> </div> What I am trying to do is come up with a jquery code that would remove the cboxElement from the first image and if I click on one of the images to remove cboxElement and place cboxElement to the other images... I also have this big image and when you click on one of the thumbnails, the image is replaced by the thumbnail and thats really the thumbnail I want to exclude...Could I possible just say if one of the 3 images src = this one image = src remove the class from this thumbnail? Which way would be better? I am very new at jquery :( I hope this makes sense. Here is the code for the big image... <a class="preview_link cboxElement" style="text-decoration:none;" href="http://www.taranmarlowjewelry.com/wp-content/uploads/2012/07/DSC_0118.jpg" rel="Teardrop Druzy Amethyst Ring"> <img id="product_image_736" class="product_image colorbox-736" width="400" src="http://www.taranmarlowjewelry.com/wp-content/uploads/2012/07/DSC_0118.jpg" title="Teardrop Druzy Amethyst Ring" alt="Teardrop Druzy Amethyst Ring"> <br> <div style="text-align:center; color:#F39B91;">Click To Enlarge</div> </a> Any help or a point in the right direction would be awesome!!

    Read the article

  • Facebook share title not working

    - by sakthi
    I have used following code for Facebook share in my website $attachment = array( 'message' => "myTaste || real restaurant reviews, share your taste on myTaste", 'link' => $review['business']['personal_url'], 'title' => $review['user']['name_display']." has reviewed ".$review['business']['name'], 'description' => $review['business']['review']['review'], 'image'=> "http://dev.mytaste.com.au/images/gui/header/mytaste.gif" ); $facebook->api("/".$usid."/links", "post",$attachment); But it does not recognize the title attribute,It just shows page title only,any one can suggest me?

    Read the article

  • Emailing a picture to a Google App Engine site

    - by Dan Hook
    I would like to create an app such that I can send an email with a JPEG attachment and then display it on my site. I am fairly certain that the Mail API allows me to do this, but if it isn't possible please let me know. My biggest concern is what are the limits on the attachment size my app can receive, and what are the quotas related to receiving email? The email quotas I saw seemed to specify quotas for outgoing email. Is it different for incoming mail?

    Read the article

  • With paperclip, how can I change the image location to a ":parent_model_id/:id" folder format?

    - by Jamis Charles
    Given that I have a Listing model that has many images and each image has one attachment, how can I have the listing_id be part of the folder structure? Like so: system/photos/[listing_id]/:id I know that using :id will output the id of the image record. Here's what I currently have: class Image < ActiveRecord::Base belongs_to :listing #Rails ActiveRecord Relation. An image belongs to a post. # paperclip data has_attached_file :photo, :styles => { :medium => "300x300>", :thumb => "100x100>" }, :url => "/public/system/:class/:attachment/:id/:style_:filename" end

    Read the article

  • Paperclip generating wrong URLs in Heroku

    - by Tony
    Paperclip is generating wrong URLs in Heroku. I have an Audio model which has a mp3 field as follows: class Audio < ActiveRecord::Base has_attached_file :mp3, :storage => :s3, :s3_credentials => S3_CREDENTIALS, :bucket => S3_CREDENTIALS[:bucket], :path => ":rails_root/public/system/:attachment/:id/:style/:filename", :url => "/system/:attachment/:id/:style/:filename" I am calling audio.mp3.url from a controller, and it returns http://s3.amazonaws.com/MyApp/audios/mp3s//original/96a9ae89302fdf8462ee05eb829f2e17578b144e20120908-2-11f61zr.mp3?1347135050 instead of http://s3.amazonaws.com/MyApp/audios/mp3s/000/000/004/original/96a9ae89302fdf8462ee05eb829f2e17578b144e20120908-2-11f61zr.mp3?1347135050 (which works) Why is it missing the '000/000/004' part of the route? The same model is generating the right URL when used in a view. Any help? I am using paperclip 3.2.0 and Rails 3.1.8. Any help?

    Read the article

  • Automate delivery of Crystal Reports With a Windows Service

    In this article, Vince demonstrates the creation of a Windows Service to automatically run and send a Crystal Report as an email attachment. After a basic introduction, he examines the creation of the database and windows service with the help of relevant source code and explanations. Towards the end of the article, Vince discusses the steps to be followed in order to install the windows service.

    Read the article

  • This Year's SQL Christmas Card

    - by Mike C
    This year's Christmas Card is similar to last year's. I used the geometry data type again for a spatial data design. Just download the attachment, unzip the .SQL script and run it in SSMS. Then look at the Spatial Data preview tab for the result. Also don't forget to visit http://www.noradsanta.org/ if your kids want to track Santa. Merry Christmas, Happy Holidays and have a great new year!...(read more)

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >