upload

PHP upload/read files on separate drive

﹥>﹥吖頭↗ 提交于 2019-12-02 11:40:18
I need to be able to upload/view files on a separate drive. Right now, my site is in the htdocs folder on the C: drive. We have been allocated space on the D: drive to upload and view files. Using the code below, I can use scandir to view what is located in htdocs folder: <?php $dir = '../../htdocs/'; $files1 = scandir($dir); $files2 = scandir($dir, 1); print_r($files1); print_r($files2); ?> But I need to traverse back a few more to be able to get to the D: drive. I am not sure if this is even possible. Using the above code, when I attempt to traverse to the D: drive, the path would look

Auto open file input on IE

时光总嘲笑我的痴心妄想 提交于 2019-12-02 11:34:28
问题 Is it possible to auto open the file input on IE? If you do $(input).click(); IE doesn't submit the form. Maybe i can get its value somehow? $(input).val() Doesnt work, this will give you fakepath. Any Idea about this? Cloning does also not work. Another possibility woudl be, to place the open button somwhere else on the page, without the input box for the path. Is anything like this possible somehow? I have some img's and if you click on these images a file browser should pop up. Maybe

primefaces FileUploadEvent returns null

余生颓废 提交于 2019-12-02 11:29:57
I'm trying to upload a file with primefaces fileuploader but it returns null, addPhotos.xhtml : <h:form id="importDevicesForm" enctype="multipart/form-data"> <h:outputText value="Photo :" /> <p:fileUpload id="scriptUpload" widgetVar="importDevicesWidget" fileUploadListener="#{docBean.file}" auto="true" label="Choisir une photo.." mode="advanced" allowTypes="/(\.|\/)(gif|jpe?g|png)$/"> <h:outputText value="Description :" /> <p:commandButton value="Ajouter" action="#{docBean.ajouter_photo}"/> </h:form> My backing bean : I want to upload the file an use an outputStream to write the file in

php file uploader not uploading

旧巷老猫 提交于 2019-12-02 11:13:17
I'm making an uploader for a website which is designed to upload videos. As of now, it doesn't check if they're videos, it's simply uploads them. I do this through a simple form that selects a file and submits it to upload.php . Here is the HTML which I do this with: <form action="upload.php" method="post" enctype="multipart/form-data" target="upload_target" onsubmit="startUpload();"> Video Name: <input type="text" name="name" class="maininput" style="width:300px;" maxlength="80"><br> File: <input name="myfile" type="file" class="mainbutton"/ style="clear:both;"><br> Description: <br><textarea

php upload image with form not working

别等时光非礼了梦想. 提交于 2019-12-02 10:52:44
I tried a lot suggestions at other people's threats about the same problem, but they didn't work. Can anyone see what I'm doing wrong? Part of my form: <form id="register-Form" name="register-Form" method="post" enctype="multipart/form-data" action="exec.php"> <div class="register-line"> <div class="ricon"><i class="fa fa-male"></i> </div> picture <input id="file" type="file" name="file" class="register-text"> </input> </div> exec.php code $target_path = "/images/"; $target_path = $target_path . basename( $_FILES['file']['name']); if(move_uploaded_file($_FILES['file']['tmp_name'], $target_path

Photo upload CodeIgniter

丶灬走出姿态 提交于 2019-12-02 10:36:33
When I upload a photo using CodeIgniter, the name of the image is changed to a random name like "107fb08f4a11cc37a040237cdcf0e48a.jpg" for example. I am having trouble showing the image from the database in the view because it is showing the original upload name and not the new name. How do I disable the function that changes this name? These are the config settings: $config = array( 'upload_path' => './uploads/', 'allowed_types' => 'gif|jpg|png', 'max_size' => '6000', 'max_width' => '2068', 'max_height' => '1032', 'encrypt_name' => true, ); change : 'encrypt_name' => true, to: 'encrypt_name'

I am so confused with uploading files in PHP

风格不统一 提交于 2019-12-02 10:30:44
I have tried reading multiple tutorials, the PHP documentation and have no idea what I am doing. Here is my form <form action="beta_upload.php" enctype="multipart/form-data" method="post"> <input type="hidden" name="MAX_FILE_SIZE" value="20971520" /><!-- 20 Meg --> <input type="file" name="file[]" /> <input type="file" name="file[]" /> <input type="file" name="file[]" /> <input type="submit" value="submit" name="submit" /> </form> Now when I send that through here: <?php $username = trim($_POST['username']); $password = trim($_POST['password']); $name = trim($_POST['name']); $email = trim($

Camel saves full http request but I want only attached file

心已入冬 提交于 2019-12-02 10:18:31
I have the following code base: @Component public class DummyRoute extends RouteBuilder { @Override public void configure() throws Exception { rest("/upload").post().to("file://rest_files"); } @Bean public ServletRegistrationBean servletRegistrationBean() { SpringServerServlet serverServlet = new SpringServerServlet(); ServletRegistrationBean regBean = new ServletRegistrationBean( serverServlet, "/rest/*"); Map<String,String> params = new HashMap<>(); params.put("org.restlet.component", "restletComponent"); regBean.setInitParameters(params); return regBean; } @Bean public org.restlet.Component

i got a undefined index error when file upload in php

冷暖自知 提交于 2019-12-02 10:17:16
i searched again and again but could not find the right answer. here is the situation. i got more than one forms in the same php file and below shows the code. when i echo as below echo count($_FILES["fileUploadPath"] ); it shows 0 as the count and Notice: Undefined index: addProjectFileUploadPath in C:\wamp... updated: probelm solved..... error came due to 3rd party jquery plugin called "fileinput" Ernest add enctype="multipart/form-data" to the form Try looking at the entire array with this: echo "<pre>".print_r($_FILES,true)."</pre>"; Then use this manual page to let you know what the error

Prevent idle state when uploading (web app on iOS)

两盒软妹~` 提交于 2019-12-02 10:08:13
I'm building a web application that will be used on mobile and desktop, and after testing on iOS, I've noticed that my phone will go into an idle state (screen turns off, presented with lock screen on return) even if there is a file being uploaded (ajax upload). Is there any way to prevent this from happening? I'm testing the app by running it as a 'home-screened' web app (ie. a website you've saved to the home screen) if that makes a difference. Originally I couldn't find an answer to this (most likely due to my particular phrasing of the question), but I ended up adding the following to my