uploading

PHP Upload File Validation

不打扰是莪最后的温柔 提交于 2019-11-29 04:34:52
I am creating file upload script and I'm looking for the best techniques and practices to validate uploaded files. Allowed extensions are: $allowed_extensions = array('gif','jpg','png','swf','doc','docx','pdf','zip','rar','rtf','psd'); Here's the list of what I'm doing. Checking file extension $path_info = pathinfo($filename); if( !in_array($path_info['extension'], $allowed_extensions) ) { die('File #'.$i.': Incorrent file extension.'); } Checking file mime type $allowed_mimes = array('image/jpeg','image/png','image/gif','text/richtext','multipart/x-zip','application/x-shockwave-flash',

Load local image into browser using JavaScript?

陌路散爱 提交于 2019-11-29 03:03:14
I'm currently developing a solution for a web-to-print, poster printing application. One of features I'd like to include is the ability to 'edit' (crop/scale/rotate) a given image, before proceeding to order a poster of said image. To avoid the requirement of the user uploading the image to a remote server before editing, I'd like to know the following: Is it possible (using JavaScript) to load an image stored on the client machine into the browser / browser memory for editing, without uploading the image to a remote server? And if so, how is this done? Thanks, BK Using Html/Javascript you can

How to config “CommonsMultipartResolver” in spring4 without xml to upload file

跟風遠走 提交于 2019-11-28 21:14:24
I use xml config spring4 is work well.like this: <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver" p:defaultEncoding="utf-8" > <!-- one of the properties available; the maximum file size in bytes --> <!-- <property name="maxUploadSize" value="40000000" /> --> </bean> when I config spring4 without xml.like this: @Configuration @ComponentScan({ "common.user", "service" }) @EnableWebMvc public class SpringMVCConfig { @Bean public ViewResolver createInternalResourceViewResolver() { InternalResourceViewResolver viewResolver = new

Uploading to FTP using Java

女生的网名这么多〃 提交于 2019-11-28 20:54:30
I was just wondering if there was a simple way I could upload a small file to a ftp server. I've checked out Apache Commons Net library but that seems quite complicated to be honest. Is there any simpler way to upload a small file to ftp? Ended up using the Apache Commons Net Library, wasn't too hard. From this link: Upload files to FTP server using URLConnection class . No external library necessary. String ftpUrl = "ftp://%s:%s@%s/%s;type=i"; String host = "www.myserver.com"; String user = "tom"; String pass = "secret"; String filePath = "E:/Work/Project.zip"; String uploadPath = "

What is the best client side browser library to upload multiple files over http?

浪尽此生 提交于 2019-11-28 09:09:09
What is the best client side http library to upload multiple files? If it can handle directories that's a huge bonus. I'm looking for something that is open source or free. I'm looking for something like FTP, but that works over http, through the browser. Uploading multiple files through a normal HTML 4.x form is a bit of a hassle when it comes to uploading more than 5-6 files. Feel free to share your personal experiences. Uploadify is also another great multiple file uploader. It was built off of SWFUpload and they added new features to it. Some of the features that I have found most helpful

reduce image size while uploading using the following PHP code used to upload image

佐手、 提交于 2019-11-28 07:05:58
Am trying to upload image to server using the following code Following are done with the given code below Upload file renaming What i need is i need to reduce image size with the following code Here is the code $file_name = $HTTP_POST_FILES['ufile']['name']; $random_digit = md5(rand() * time()); $new_file_name = $random_digit . $file_name; $path = "upload/" . $new_file_name; if ($ufile != none) { if (copy($HTTP_POST_FILES['ufile']['tmp_name'], $path)) { echo "Successful<BR/>"; echo "File Name :" . $new_file_name . "<BR/>"; echo "File Size :" . $HTTP_POST_FILES['ufile']['size'] . "<BR/>"; echo

How to Upload video to server from iPhone?

感情迁移 提交于 2019-11-28 06:06:54
-(IBAction)uploadToServer :(id)sender { NSString *str1=[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"intro.mp4"]; NSLog(@"str1=%@",str1); NSString *escapedUrlString = [str1 stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSLog(@"escapedUrlString=%@",escapedUrlString); NSURL *videoURL = [NSURL URLWithString:escapedUrlString]; NSLog(@"videoURL=%@",videoURL); NSData *newdata = [NSData dataWithContentsOfFile:escapedUrlString]; webdata=[NSData dataWithData:newdata]; NSLog(@"webData = %@",webdata); [self post:webdata]; } - (void)post:(NSData *)fileData {

Load local image into browser using JavaScript?

人盡茶涼 提交于 2019-11-27 21:33:44
问题 I'm currently developing a solution for a web-to-print, poster printing application. One of features I'd like to include is the ability to 'edit' (crop/scale/rotate) a given image, before proceeding to order a poster of said image. To avoid the requirement of the user uploading the image to a remote server before editing, I'd like to know the following: Is it possible (using JavaScript) to load an image stored on the client machine into the browser / browser memory for editing, without

Uploading to FTP using Java

寵の児 提交于 2019-11-27 20:48:01
问题 I was just wondering if there was a simple way I could upload a small file to a ftp server. I've checked out Apache Commons Net library but that seems quite complicated to be honest. Is there any simpler way to upload a small file to ftp? Ended up using the Apache Commons Net Library, wasn't too hard. 回答1: From this link: Upload files to FTP server using URLConnection class. No external library necessary. String ftpUrl = "ftp://%s:%s@%s/%s;type=i"; String host = "www.myserver.com"; String

Increase file upload size limit in iis6

て烟熏妆下的殇ゞ 提交于 2019-11-27 07:40:50
Is there any other place besides the metabase.xml file where the file upload size can be modified? I am currently running a staging server with IIS6 and it is setup to allow uploading of files up to 20mb. This works perfectly fine. I have a new production server where I am trying to setup this same available size limit. So I edited the metabase.xml file and set it to 20971520. Then I restarted IIS and that didn't work. So I then restarted the entire server, that also didn't work. I can upload files around 2mb so it is definitely allowing file sizes larger then the standard 200kb default size.