upload

Php oop file upload

蓝咒 提交于 2019-12-04 19:18:19
I work on a oop php file upload script. Is simple. But doesnt work. What is the problem? I learn how to use $_FILE, and how to code oop style. Thanks. upload.php are : <?php class upload{ public $src = "./upload/"; public $tmp; public $filename; public $type; public $uploadfile; public function startupload(){ $this -> filename = $_FILES["file"]["name"]; $this -> tmp = $_FILES["file"]["tmp_name"]; $this -> uploadfile = $src . basename($this -> name); } public function uploadfile(){ if(move_uploaded_file($this -> tmp, $this -> uploadFile)){ return true; } } } ?> index.php are: <?php require_once

PHP File Upload, files disappearing from /tmp before move_uploaded_files

我是研究僧i 提交于 2019-12-04 17:35:14
问题 I have a very basic upload script, probably lifted straight off the php.net/move_upload_files function page. move_uploaded_file() is failed because it cannot find the tmp file in the tmp folder. But I KNOW that it is being put there, but is removed before move_upload_file() can deal with it in my script. I know it is being put there since I can see a file in there when a large file is being posted to the server. Also $_FILES contains correct details for the file I have just uploaded. Had

PHP upload fail (empty $_FILES)

怎甘沉沦 提交于 2019-12-04 17:26:03
I have a common problem in PHP : My $_FILES array is empty when files are too big. php.ini : max_execution_time = 300000 max_input_time = 600000000 memory_limit = 5100MB post_max_size = 5000MB upload_max_filesize = 5000MB The file : Trouve.tar : 910Mo Configuration values are huge but I want to be sure that the script have the time and the memory to do the upload. So, the authorized size is bigger than the file size, but I have the same error than other people (like problem with uploading the images with php file upload for exemple) Have I missed some configuration setting ? Instead of MB use

How to get MIME type of uploaded file in Jersey

只谈情不闲聊 提交于 2019-12-04 17:11:30
问题 I have a standard upload endpoint in Jersey: @POST @Secure @Consumes("multipart/form-data") public Response upload( @Context final HttpHeaders hh, @FormDataParam("fileaaa") final FormDataContentDisposition disposition, @FormDataParam("fileaaa") final InputStream input, How can I get the MIME type of the uploaded file? If I do disposition.getType this gets me the MIME type of the form; in this case form-data . I know the information is there somewhere; the HTTP message should be something like

Selenium - upload file to iframe

亡梦爱人 提交于 2019-12-04 17:04:28
I have a test which has method to upload file in form located in iframe . The problem is that test not stable and sometimes fails with the error (run three times to get error example, third run failed): def fill_offer_image(self): driver = self.app.driver driver.switch_to.frame(driver.find_elements_by_name("upload_iframe")[3]) E IndexError: list index out of range I have implicitly wait = 10 and as you can consider few iframes on the page with the same class so I've been forced to use arrays. And sometimes not all (or all?) iframes loaded. Does someone have thoughts how to improve stability of

android - send parameters while uploading file

旧时模样 提交于 2019-12-04 16:58:23
I've got this piece of code http://pastebin.com/VrMNuxcv which successfully uploads a file onto the server from my android. I'd like to , however to be able to send a couple of string parameters together with it. Could you please tell me, if possible, where exactly I need to do this in that piece of code and how? Thanks Andreas I assume that you're in control of how the server processes the upload, i.e., you wrote the server code too??? If so, I simply use custom/private request properties (i.e., prefixed x-) for some client/server code I've written. Example... conn.setRequestProperty("x-myapp

non-public API usage Warning…preventing validation on upload to App store?

99封情书 提交于 2019-12-04 16:54:47
Anyone getting the following issues on a recent build that you trying to upload to the store? 1. Your app contains non-public API usage. Please review the errors, correct them, and resubmit your application. 2. Apps are not permitted to access the UDID and must not use the uniqueIdentifier method of UIDevice. Please update your apps and servers to associate users with the Vendor or Advertising identifiers introduced in iOS 6. It is thus failing validation and not uploading. PerkinsB1024 Apple recently disallowed developers from accessing the device's UDID (Unique Device Identifier), but some

Unable to upload to App Store with Xcode 7.1

跟風遠走 提交于 2019-12-04 16:49:10
问题 When trying to upload an app to App Store in Xcode (7.1) I'm prompted with this error message: iTunes Store operation failed. You are not authorised to use this service. The steps I go through when trying to upload Product -> Archive which completes successfully Window -> Organizer where I select my app in the left pane. I then choose my most recent archive, press "Upload to App Store..." and pick the relevant development team. At that point I'm prompted with the error message "iTunes Store

Plupload Upload + Synchronous form question

不羁岁月 提交于 2019-12-04 16:34:57
I have a setup with a traditional form that's checked with jQuery Tools validator and submitted via POST. I like that this class does not require extra classnames or other superfluous metadata to validate, standard HTML5 attributes are enough. I now would like to extend this functionality with the Plupload upload solution. I know that all modern upload solutions work via Ajax these days, so I was thinking about a setup in which the user fills out the form, puts files in the upload queue and then submits the form. The form submit would imply: Validation through jQuery Tools Validator... If

Scan PHP uploads for viruses

孤者浪人 提交于 2019-12-04 16:20:36
I'm currently using the following code to scan files that have been uploaded as part of an application form: $safe_path = escapeshellarg($dir . $file); $command = '/usr/bin/clamscan --stdout ' . $safe_path; $out = ''; $int = -1; exec($command, $out, $int); if ($int == 0) { // all good; } else { // VIRUS!; } It works, but is slow. Anyone got any suggestions that would a). speed things up and b). improve the script generally (for instance, I'm not entirely clear on the benefits of exec() vs system(), etc)? If the speed can't be improved then I'd ideally like to display some kind of interim